Re: [PATCH 3/5] setup: defer object database creation
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Aug 4, 2026, 07:21 UTC
- Message-ID
- <anGTC81J4q76fUr1@pks.im>
- In-Reply-To
- <xmqq5x246x35.fsf@gitster.g>
On Fri, Jul 24, 2026 at 11:50:38AM -0700, Junio C Hamano wrote:
Show 19 quoted lines
> Patrick Steinhardt <ps@pks.im> 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