From: Junio C Hamano <gitster@pobox.com>
To: "Kristofer Karlsson via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Derrick Stolee <stolee@gmail.com>,
Kristofer Karlsson <krka@spotify.com>
Subject: Re: [PATCH 0/2] commit-reach: fix !FIND_ALL early exit with v1 commit graph
Date: Mon, 29 Jun 2026 10:50:01 -0700 [thread overview]
Message-ID: <xmqqldbxw81i.fsf@gitster.g> (raw)
In-Reply-To: <pull.2162.git.1782739162.gitgitgadget@gmail.com> (Kristofer Karlsson via GitGitGadget's message of "Mon, 29 Jun 2026 13:19:19 +0000")
"Kristofer Karlsson via GitGitGadget" <gitgitgadget@gmail.com>
writes:
> 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
Where should this new "gen_ordered" flag go in the world with
kk/merge-base-exhaustion topic merged in? Does it also belong
to the paint_state struct or can it be on-stack independent variable
to the function?
next prev parent reply other threads:[~2026-06-29 17:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Junio C Hamano [this message]
2026-06-29 18:27 ` [PATCH 0/2] commit-reach: fix !FIND_ALL early exit with v1 commit graph Kristofer Karlsson
2026-06-29 18:52 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqldbxw81i.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=krka@spotify.com \
--cc=stolee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox