From: Patrick Steinhardt <ps@pks.im>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 12/13] odb: handle changing a repository's commondir
Date: Fri, 21 Nov 2025 09:12:48 +0100 [thread overview]
Message-ID: <aSAfAJscjYHAg3Mc@pks.im> (raw)
In-Reply-To: <xmqq34687414.fsf@gitster.g>
On Thu, Nov 20, 2025 at 02:06:15PM -0800, Junio C Hamano wrote:
> Patrick Steinhardt <ps@pks.im> writes:
>
> > -static void set_git_dir_1(const char *path)
> > +static void setup_git_env_internal(const char *git_dir,
> > + bool skip_initializing_odb)
> > +{
>
> Hopefully we won't gain too many callers of this function, and ...
>
> > +static void set_git_dir_1(const char *path, bool skip_initializing_odb)
> > {
>
> ... this function, as ...
>
> > - set_git_dir_1(path);
> > + set_git_dir_1(path, true);
> > ...
> > - set_git_dir_1(path);
> > + set_git_dir_1(path, false);
>
> ... it is almost impossible to tell from the call site which one is
> for initializing the ODB (hint: "true" does initialize the ODB, oh,
> no it is the other way around, or is it correct? now everybody is
> confused).
>
> We could do "enum { INIT_DB, NO_INIT_DB }" instead of bool and the
> calling sites would become self-describing, but as long as we won't
> have too many calling sites, the current code should be OK.
Quite frankly, the whole "setup.c" file could use a makeover. I would
claim it's almost impossible to understand the different flows we have
here, and the setup of a repository (or `the_reposiory`) is awfully
complex and non-obvious.
Some ICs in my team might tackle this in the Git 2.53 release cycle,
hopefully.
Patrick
next prev parent reply other threads:[~2025-11-21 8:12 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-19 7:50 [PATCH 00/13] Centralize management of object database sources Patrick Steinhardt
2025-11-19 7:50 ` [PATCH 01/13] path: move `enter_repo()` into "setup.c" Patrick Steinhardt
2025-11-19 7:50 ` [PATCH 02/13] setup: convert `set_git_dir()` to have file scope Patrick Steinhardt
2025-11-19 7:50 ` [PATCH 03/13] odb: adopt logic to close object databases Patrick Steinhardt
2025-11-19 7:50 ` [PATCH 04/13] odb: refactor `odb_clear()` to `odb_free()` Patrick Steinhardt
2025-11-19 7:50 ` [PATCH 05/13] odb: move logic to disable ref updates into repo Patrick Steinhardt
2025-11-19 20:51 ` Junio C Hamano
2025-11-21 7:48 ` Patrick Steinhardt
2025-11-19 7:50 ` [PATCH 06/13] oidset: introduce `oidset_equal()` Patrick Steinhardt
2025-11-19 20:59 ` Junio C Hamano
2025-11-19 7:50 ` [PATCH 07/13] builtin/index-pack: fix deferred fsck outside repos Patrick Steinhardt
2025-11-19 21:27 ` Junio C Hamano
2025-11-21 7:48 ` Patrick Steinhardt
2025-11-19 7:50 ` [PATCH 08/13] t/helper: stop setting up `the_repository` repeatedly Patrick Steinhardt
2025-11-19 7:50 ` [PATCH 09/13] http-push: stop setting up `the_repository` for each reference Patrick Steinhardt
2025-11-19 7:50 ` [PATCH 10/13] odb: handle initialization of sources in `odb_new()` Patrick Steinhardt
2025-11-19 7:50 ` [PATCH 11/13] chdir-notify: add function to unregister listeners Patrick Steinhardt
2025-11-19 7:51 ` [PATCH 12/13] odb: handle changing a repository's commondir Patrick Steinhardt
2025-11-20 22:06 ` Junio C Hamano
2025-11-21 8:12 ` Patrick Steinhardt [this message]
2025-11-19 7:51 ` [PATCH 13/13] odb: handle recreation of quarantine directories Patrick Steinhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aSAfAJscjYHAg3Mc@pks.im \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).