On Thu, 29 Oct 2026 at 17:57, Justin Tobler [off-list ref] wrote:
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.
quoted
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