Re: [PATCH v7 07/10] commit-reach: introduce struct paint_state with per-side counters
- From
Kristofer Karlsson <krka@spotify.com>
- Date
- Aug 7, 2026, 11:47 UTC
- Message-ID
- <CAL71e4MULMmbMyrE2iKgNXD36vpjnxCYXTcNw75ibu_nwxqAPQ@mail.gmail.com>
- In-Reply-To
- <CABPp-BFqghtx4p_Nqx+AWpU7SVn3mXOZGDQ0yoN-ZYQgXmZC=g@mail.gmail.com>
On Fri, 7 Aug 2026 at 05:02, Elijah Newren <newren@gmail.com> wrote:
> > became -> become
Good catch, will fix.
> So: pop, clear, check the counters, and _then_ decrement the counters. > This means the zero-counter-check still include the just-popped > commit. If the decrement were before the check, we'd actually just > barely miss the merge-base most the time, so this order is important.
Yes, I should perhaps add a code comment for this to ensure it does not get corrupted in the future. Something like this:
/* must check exit conditions before decrementing counters
for the dequeued commit -- the counters may otherwise be
be temporarily zero until the commit has been processed
and its parent nodes have been enqueued.
*/Or is it overkill?
Thanks, Kristofer