[PATCH v2 0/2] connected: fix the connectivity check with alternates in deepening fetches
- From
- Igor Wiedler <iwiedler@gitlab.com>
- Date
- Oct 14, 2026, 18:11 UTC
- Message-ID
- <20261014181134.56220-1-iwiedler@gitlab.com>
- In-Reply-To
- <20261014103507.35317-1-iwiedler@gitlab.com>
In a deepening fetch the connectivity check runs rev-list with "--alternate-refs" as a positive revision, so it walks the alternate's whole history. With a 7M-object alternate the check takes 227s after a fetch that received an empty pack.
Changes since v1:
* The connectivity check negates "--alternate-refs" in both cases, as Junio suggested, instead of dropping it for deepening fetches. The alternate's refs are a boundary like our own refs. Compared to Junio's diff, "--alternate-refs" moved up next to "--all" so that the comment above "--not" covers all of the boundary arguments.
* New second patch: odb_for_each_alternate_ref() ignores the refs of shallow and grafted alternates, so that neither the connectivity check, nor fetch-pack's "have"s, nor receive-pack's ".have"s treat history that the alternate does not have as present. Partial clones are not detected, see the commit message.
v1: https://lore.kernel.org/git/20261014103507.35317-1-iwiedler@gitlab.com/
Igor Wiedler (2): connected: negate alternate refs in deepening fetches too odb: ignore refs of shallow and grafted alternates
Documentation/rev-list-options.adoc | 7 ++++--- connected.c | 6 ++++-- odb.c | 11 +++++++++++ t/t5618-alternate-refs.sh | 25 +++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 5 deletions(-)
base-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd
-- 2.56.0