Re: [PATCH v3 0/4] connected: add incremental connectivity check
- From
Kristofer Karlsson <krka@spotify.com>
- Date
- Oct 13, 2026, 07:54 UTC
- Message-ID
- <CAL71e4OUW4rYqxaGgcrsy0aqjRSdWsz8ghtNRGQVYd9Gkz4NgQ@mail.gmail.com>
- In-Reply-To
- <xmqqzewi695w.fsf@gitster.g>
On Mon, 12 Oct 2026 at 20:55, Junio C Hamano <gitster@pobox.com> wrote:
Show 12 quoted lines
> > "Kristofer Karlsson via GitGitGadget" <gitgitgadget@gmail.com> > writes: > > > I'll just mention a short summary here, to avoid repeating what's already in > > the commit message. The incremental mode is faster than the full mode when > > there are few commits to verify and when the active object tree is large. In > > the happy case, the work tracks the changed paths and their comparison trees > > rather than the full reachable object closure, which substantially reduces > > the dependence on total repository size. > > This is exciting.
I think so too, especially since I think it simplifies the follow-up where the scaling with number of refs can also be addressed and I hope to write up some more concrete ideas for that in the not too distant future.
Show 9 quoted lines
> > There are also regression cases in the synthetic fixtures. With long > > incoming histories, the extra parent-tree scans accumulate; in the synthetic > > fixture incremental is about 1.5x slower at 10000 commits. Per-commit > > ... > > A safety net for this regression could be to dynamically disable the > > incremental mode if the number of incoming commits is too large, but this is > > left out of the initial version to avoid overly speculative code. > > Hmm, ... OK.
This is where I would need feedback from you and the mailing list. I have been reasoning about this internally and decided to simply submit the smallest approach as a starting point.
Now with the config flag in place to gate usage as well as having the worst-case regression bounded in how bad it can be (2x more time, not worse in memory) I was thinking it may not need further protection. I was also not sure how common it would be to get pushes with so many commits that it becomes an issue, and that part is fundamentally hard to know for git as a general tool.
That said, I'd be happy to introduce some extra safety net here, perhaps add a fallback if there are more than N commits to verify. (Hardcoded based on synthetic benchmarks? Configurable?)
One partly annoying thing here may be that if we add fallback for the bad case, it forces us to keep both code paths and thus lose the potential for removing code. My dream scenario would be if there was a single implementation of the connectivity check that performs well enough in all scenarios, but maybe that will come anyway eventually and I should not speculate too much.
What would be your preferred approach here?
Thanks, Kristofer