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

Justin Tobler <[email protected]> Tue, 28 Jul 2026 16:13:42 -0500
Newsgroups org.kernel.vger.git
Message-ID <amkXcmwzbBYsMgjc@denethor>
On 26/07/24 05:48AM, Patrick Steinhardt wrote:
> In a subsequent commit we'll make the creation of the on-disk data
> structures of an object database pluggable. This will lead to an
> in-between state where we have already configured the repository's
> object database, but it's not usable yet until we eventually call
> `create_object_directory()`.
>
> Defer the object database creation so that we handle both steps in the
> same function.

So IIUC, the repository gets configured via `apply_repository_format()`
which invokes `odb_new()`. In this patch a
APPLY_REPOSITORY_FORMAT_SKIP_ODB_CREATION flag is introduced to allow
the creation of the ODB to be delayed until after source specific
on-disk state has been created.

Naive question: would it be simpler to just require invoking `odb_new()`
explicitly after `apply_repository_format()` in all cases? There doesn't
appear to be too many callsites.

-Justin