Re: [PATCH 3/5] setup: defer object database creation

Patrick Steinhardt <[email protected]> Tue, 4 Aug 2026 09:21:47 +0200
Newsgroups org.kernel.vger.git
Message-ID <[email protected]>
On Fri, Jul 24, 2026 at 11:50:38AM -0700, Junio C Hamano wrote:
> Patrick Steinhardt <[email protected]> writes:
> > diff --git a/setup.c b/setup.c
> > index 825572f5f1..a7b1b9eaef 100644
> > --- a/setup.c
> > +++ b/setup.c
> > @@ -2885,7 +2902,9 @@ int init_db(struct repository *repo,
> >  
> >  	if (!(flags & INIT_DB_SKIP_REFDB))
> >  		create_reference_database(repo, initial_branch, flags & INIT_DB_QUIET);
> > -	create_object_directory(repo);
> > +	create_object_database(repo);
> > +
> > +	startup_info->have_repository = 1;
> 
> Instead we call create_object_database() rather late, after we
> finish creating leading directories and default files and processing
> the configuration.  I guess this is a prelude to specifying "no, we
> are not doing the files backend but are using this new thing" in the
> global configuration?

Yes, exactly. Many of the refactorings I'm doing in "setup.c" ultimately
have the goal to detangle the setup and configuration of repository
extensions. It's been painful back when I introduced the "refStorage"
extension, and it's still painful now with the planned "objectStorage"
extension. So this time around I decided to detangle the logic before
introducing the extension to make the infra easier to understand going
forward.

Patrick