Git development
 help / color / mirror / Atom feed
* [PATCH 0/2] commit-reach: fix !FIND_ALL early exit with v1 commit graph
@ 2026-06-29 13:19 Kristofer Karlsson via GitGitGadget
  2026-06-29 13:19 ` [PATCH 1/2] t6600: add test for merge-base early exit with clock skew Kristofer Karlsson via GitGitGadget
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Kristofer Karlsson via GitGitGadget @ 2026-06-29 13:19 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Derrick Stolee, Kristofer Karlsson

Fixes a bug introduced by 93e5b1680e (commit-reach: early exit
paint_down_to_common for single merge-base, 2025-04-10) where git merge-base
can return the wrong result.

The bug requires all of the following to trigger:

 1. A v1 commit graph (topological levels only, no corrected commit dates).
    Generation v2 with corrected commit dates has been the default since
    2021, so only repos that have not rewritten their commit graph in over
    four years would be affected.
 2. git merge-base without --all (the common case, but --all is unaffected
    because it disables the early exit).
 3. A topology with clock skew: the correct merge base has a lower committer
    date than one of its ancestors that is also a common ancestor. With date
    ordering, the deeper ancestor pops first and the early exit fires before
    the correct result is found.

This two-patch series:

 1. Adds a test demonstrating the bug (clock-skew topology where the correct
    merge base has a lower date than its ancestor)
 2. Fixes it by tracking whether the queue is generation-ordered and gating
    the early exit on that flag

Kristofer Karlsson (2):
  t6600: add test for merge-base early exit with clock skew
  commit-reach: guard !FIND_ALL early exit with generation ordering
    check

 commit-reach.c        | 10 +++++++---
 t/t6600-test-reach.sh | 41 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+), 3 deletions(-)


base-commit: 9aa172cd1f113276d360d4e48937dc95ef46b780
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2162%2Fspkrka%2Ffind-all-fix-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2162/spkrka/find-all-fix-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/2162
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-06-29 18:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-29 13:19 [PATCH 0/2] commit-reach: fix !FIND_ALL early exit with v1 commit graph Kristofer Karlsson via GitGitGadget
2026-06-29 13:19 ` [PATCH 1/2] t6600: add test for merge-base early exit with clock skew Kristofer Karlsson via GitGitGadget
2026-06-29 13:19 ` [PATCH 2/2] commit-reach: guard !FIND_ALL early exit with generation ordering check Kristofer Karlsson via GitGitGadget
2026-06-29 17:50 ` [PATCH 0/2] commit-reach: fix !FIND_ALL early exit with v1 commit graph Junio C Hamano
2026-06-29 18:27   ` Kristofer Karlsson
2026-06-29 18:52     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox