git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] odb: do not list our own refs as alternate refs in the quarantine

From
Kristofer Karlsson <krka@spotify.com>
Date
Oct 30, 2026, 11:51 UTC
Message-ID
<CAL71e4PXZ8-T3RgLQQLtL2ASQMLbRrChfV6wAqxFSd_Tw7-2Sg@mail.gmail.com>
In-Reply-To
<xmqqfqxo4dy1.fsf@gitster.g>
On Thu, 29 Oct 2026 at 18:24, Junio C Hamano <gitster@pobox.com> wrote:
Show 15 quoted lines
>
> In other words, if we tell our quarantine child where our real
> object directory is, say, via the 'GIT_QUARANTINE_OBJECT_DIRECTORY'
> environment variable, can the child notice the variable and identify
> which of the passed alternates is the real object directory, so that
> it knows not to use the refs associated with it?
>
> It is a bit of a shame that tmp_objdir_create() exports the same
> value as DB_ENVIRONMENT in GIT_QUARANTINE_ENVIRONMENT, as the only
> existing use of the latter is to check if the variable is exported
> or not---in other words, to carry a single bit of information ("are
> we in quarantine or not").  I wonder if we can change its value to
> name the parent process's real object directory instead?  Then we
> would not need to export yet another variable to carry the
> information we need.
Agreed, I think that is a reasonable way forward to a concrete fix.

I started working on a v2 based on your suggestion there. First I tried tweaking GIT_QUARANTINE_PATH to point to the real object dir, but I realized that might be unsafe since some hooks may depend on the semantics of that env variable, so it would be a breaking change.

Then I started adding a second env variable. That worked and it was not _too_ messy though I realized it was a bit redundant. We can simply deduce the real object directory from the quarantine directory -- it's the parent, based on how tmp_objdir_create() works today -- so I built my preliminary v2 on that.

It feels like a slightly icky assumption to make, but it feels safe since I added tests to cover it, and does not seem possible to override outside of git itself.

That said, if you think this is over-simplifying it, I can pivot back to introducing a new environment variable instead.

Thanks! Kristofer

Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 7 in “odb: do not list our own refs as alternate refs in the quarantine”
  1. odb: do not list our own refs as alternate refs in the quarantineKristofer Karlsson via GitGitGadget, Oct 28, 2026
  2. Justin ToblerOct 29, 2026
  3. Kristofer KarlssonOct 30, 2026
  4. Junio C HamanoOct 29, 2026
  5. Kristofer KarlssonOct 30, 2026
  6. Junio C HamanoOct 30, 2026
  7. Jeff KingOct 30, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.