git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 0/2] commit-reach: fix !FIND_ALL early exit with v1 commit graph

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 29, 2026, 17:50 UTC
Message-ID
<xmqqldbxw81i.fsf@gitster.g>
In-Reply-To
<pull.2162.git.1782739162.gitgitgadget@gmail.com>

"Kristofer Karlsson via GitGitGadget" <gitgitgadget@gmail.com> writes:

Show 23 quoted lines
> 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?

Previous: Junio C HamanoNext: Kristofer Karlsson
Message 5 of 7 in “commit-reach: fix !FIND_ALL early exit with v1 commit graph”
  1. 0/2 commit-reach: fix !FIND_ALL early exit with v1 commit graphKristofer Karlsson via GitGitGadget, Jun 29, 2026
  2. 1/2 t6600: add test for merge-base early exit with clock skewKristofer Karlsson via GitGitGadget, Jun 29, 2026
  3. 2/2 commit-reach: guard !FIND_ALL early exit with generation ordering checkKristofer Karlsson via GitGitGadget, Jun 29, 2026
  4. Junio C HamanoJul 8, 2026
  5. Junio C HamanoJun 29, 2026
  6. Kristofer KarlssonJun 29, 2026
  7. Junio C HamanoJun 29, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.