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:29 UTC
Message-ID
<CAL71e4P9LauUqjKTx1VeqehGVrbOpb3PXC8z1iQ6Bh7CFihr8w@mail.gmail.com>
In-Reply-To
<auNvMUNxmeJe31Bq@denethor>
On Thu, 29 Oct 2026 at 17:57, Justin Tobler <jltobler@gmail.com> wrote:
Show 15 quoted lines
>
> This indeed sounds like a bit of a hack. To me the underlying issue here
> is that downstream git processes don't really have any concept of an ODB
> transaction. We rely on the git alternates mechanism and overriding the
> primary object directory to get the unaware child processes to behave
> how we want. This typically means setting the quarantine directory as
> the main object directory and the "real" object directory as an
> alternate via environment variables. That way any writes that are
> performed by a child process are written to the quarantine.
>
> For the connectivity check though, we don't really expect
> git-rev-list(1) to write any objects. Consequently, I don't think we
> neccessary need to set the quarantine directory as the primary object
> directory here. That would avoid git-rev-list(1) processing the "real"
> object directory references a second time.

The connectivity check explicitly disables lazy fetching so it should be safe in practice, but it's hard to reason about potential regressions and having a more strict flow for this would be nice perhaps.

Show 13 quoted lines
> >     So the question is really where this should be fixed: is there a better
> >     way for processes running inside the quarantine to tell the repository's
> >     own object directory apart from real alternates?
>
> Building off of my previous thoughts, maybe it would make sense to make
> the connectivity check a more explicit part of the ODB transaction
> interface? Maybe for the "files" backend we could introduce a
> `odb_transaction_files_check_connected()` callback that configures
> git-rev-list(1) with the appropriate environment to validate the
> quarantined objects and not cause this bug? Happy to explore this path
> further if it seems reasonable.
>
> -Justin

I am somewhat of a novice here, but I had a similar thought, that this should ideally be fixed by tweaking the API somehow, although I do not know exactly. I am not sure if we should introduce odb_transaction_files_check_connected() or resolve the alternate-refs into fixed directories earlier in the chain, or enforce better read-only mode (and add quarantine as a pure alternate for the connectivity check).

So, I am not sure what the long term fix is, but I think your idea makes sense for that. For the short term, I think something closer to what Junio suggested in the other reply is a reasonable way forward.

Thanks, Kristofer

Previous: Justin ToblerNext: Junio C Hamano
Message 3 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.