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

Re: [PATCH v3 0/2] commit-reach: use object flags for tips_reachable_from_bases()

From
Jeff King <peff@peff.net>
Date
May 19, 2026, 01:03 UTC
Message-ID
<20260519010354.GE1612961@coredump.intra.peff.net>
In-Reply-To
<pull.2116.v3.git.1778947182.gitgitgadget@gmail.com>
On Sat, May 16, 2026 at 03:59:39PM +0000, Kristofer Karlsson via GitGitGadget wrote:
Show 8 quoted lines
> v2 of this patch, addressing Jeff King's feedback:
> 
>  * Replaced the decoration hash with the RESULT object flag (simpler, no
>    extra data structure, handles duplicate tips naturally)
>  * Fixed early-termination bug when multiple refs point to the same commit
>    (the decoration API overwrites on duplicate keys)
>  * Removed the now-unused index field from struct commit_and_index
>  * Diff is +11/-12 lines

Using the object flag here is so much nicer. I see you're reusing the RESULT flag. I'm not sure offhand if there might be any conflict with other uses of that flag bit. I think probably not, since it looks like it is cleared by the other users after they leave their respective functions?

Using a direct set-inclusion check with the flag is nice, but we still look at min_generation_index. If I'm understanding the code right, this is mostly about counting the tips we've seen. Which at first glance means we could probably replace that code with some kind of counter. But I think maybe there is some notion of "crossing off" commits which we don't actually visit, but which we know become un-visitable because we traverse past their generation numbers.

I think. This is really the first time I'm looking at this code. So AFAICT your patch as-is is correct, but it would be nice to go an ACK from Stolee.

-Peff
Previous: Kristofer Karlsson via GitGitGadgetNext: Derrick Stolee
Message 9 of 10 in “commit-reach: use the decoration hash for tips_reachable_from_bases()”
  1. commit-reach: use the decoration hash for tips_reachable_from_bases()Kristofer Karlsson via GitGitGadget, May 15, 2026
  2. Jeff KingMay 15, 2026
  3. Kristofer KarlssonMay 16, 2026
  4. Derrick StoleeMay 16, 2026
  5. commit-reach: use object flags for tips_reachable_from_bases()Kristofer Karlsson via GitGitGadget, May 16, 2026
  6. 0/2 commit-reach: use object flags for tips_reachable_from_bases()Kristofer Karlsson via GitGitGadget, May 16, 2026
  7. 1/2 commit-reach: use object flags for tips_reachable_from_bases()Kristofer Karlsson via GitGitGadget, May 16, 2026
  8. 2/2 t6600: add tests for duplicate tips in tips_reachable_from_bases()Kristofer Karlsson via GitGitGadget, May 16, 2026
  9. Jeff KingMay 19, 2026
  10. Derrick StoleeMay 21, 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.