Re: [PATCH 1/3] commit-reach: deduplicate queue entries in paint_down_to_common
- From
Jeff King <peff@peff.net>
- Date
- May 25, 2026, 07:15 UTC
- Message-ID
- <20260525071545.GD2737798@coredump.intra.peff.net>
- In-Reply-To
- <20260525070114.GB2737798@coredump.intra.peff.net>
On Mon, May 25, 2026 at 03:01:14AM -0400, Jeff King wrote:
Show 13 quoted lines
> When we drop all of those queue elements, they'll all be left with the > ENQUEUED flag set. Should we clear those? > > The ahead_behind() variant doesn't have the same problem, because it > uses PARENT2 to check for queueing, and then does: > > /* STALE is used here, PARENT2 is used by insert_no_dup(). */ > repo_clear_commit_marks(r, PARENT2 | STALE); > > So it's cleaning up both flags, whereas paint_down_to_common() is > already leaving the STALE flag set. I'm not sure how much that matters > (or if it is even an intentional thing communicated to the caller). But > now we'd be adding ENQUEUED.
Ah, hmm. We do clear flags in the callers using clear_commit_marks(), which walks down parent pointers until nobody has a flag we care about (from all_flags). I'm not 100% sure that ENQUEUED flags will always be caught that way, but I think the reasoning is roughly: every thing we queue will either have PARENT1 or PARENT2 set, so we'll keep walking and clearing flags until we stop seeing those.
-Peff