Re: [PATCH v4 5/6] connected: add incremental connectivity check via rev-list
- From
Kristofer Karlsson <krka@spotify.com>
- Date
- Oct 22, 2026, 16:11 UTC
- Message-ID
- <CAL71e4Ngsxv=JU_qzVGVyHPZiB2Qzvjn22NeVQAtZOdCr2vyXQ@mail.gmail.com>
- In-Reply-To
- <xmqq4iedkd2u.fsf@gitster.g>
On Thu, 22 Oct 2026 at 16:46, Junio C Hamano <gitster@pobox.com> wrote:
Show 14 quoted lines
> > Kristofer Karlsson <krka@spotify.com> writes: > > > Yes, and an earlier internal prototype (that I never sent) did > > this. ... > > But even then, the revision walk around the verifier and the full > > check would still depend on fetch_if_missing, so the verifier alone > > would not let us drop it. > > As use of _extended there in new code will certainly be a way to > avoid making things worse, the above in distilled form should be in > the proposed commit log message to help future readers who may > wonder why these new code paths are written to rely on the > fetch_if_missing flag.
Ah, I was not aware fetch_if_missing is something we want to move away from, but now I see it's mentioned in the docs.
I looked into the code more after your pointers and I think it's indeed doable (and not too messy, just a bit more code) to use odb_read_object_info_extended() instead and completely stop touching repo->fetch_if_missing. It's still being touched by the rest of the rev-list code, but at least this series no longer makes it worse. The full check is unaffected, since check_connected() already passes --exclude-promisor-objects in a partial clone, which clears the flag as before.
To check it, I ran rev-list --connectivity-check=incremental by hand in a partial clone, deliberately omitting --exclude-promisor-objects, on commits that reference a promised blob and a promised tree. Both were reported as missing and neither was fetched. I did not turn that into a test, since check_connected() never invokes rev-list that way, and the existing tests all pass.
This ends up nicer than what I had -- I can also get rid of the BUG() guard for checking that flag state.
So, I think my plan is to squash this change into v5.
Do you still want me to include this reasoning in the commit, or is that now unnecessary given that it would no longer touch fetch_if_missing?
Thanks, this really helped improve the patch, Kristofer