From: Derrick Stolee Date: Sun, 28 Jun 2026 15:15:35 GMT Subject: Re: [PATCH v4 8/8] commit-reach: move min_generation check into paint_queue_get() Message-ID: In-Reply-To: <8dd15d44e6a60fc39bbf6d894628507e839f9248.1782649547.git.gitgitgadget@gmail.com> On 6/28/26 8:25 AM, Kristofer Karlsson via GitGitGadget wrote: > From: Kristofer Karlsson ...> @@ -138,11 +140,23 @@ static void paint_queue_put(struct paint_state *state, > static struct commit *paint_queue_get(struct paint_state *state) > { > struct commit *commit = prio_queue_get(&state->queue); > + timestamp_t generation; > > if (!commit) > return NULL; > > commit->object.flags &= ~ENQUEUED; > + generation = commit_graph_generation(commit); > + > + if (state->min_generation && generation > state->last_gen) > + BUG("bad generation skip %"PRItime" > %"PRItime" at %s", > + generation, state->last_gen, > + oid_to_hex(&commit->object.oid)); > + state->last_gen = generation; > + > + /* generation cutoff */ > + if (generation < state->min_generation) > + return NULL; ... > - if (min_generation && generation > last_gen) > - BUG("bad generation skip %"PRItime" > %"PRItime" at %s", > - generation, last_gen, > - oid_to_hex(&commit->object.oid)); > - last_gen = generation; > - > - if (generation < min_generation) > - break; I'm just stopping in to say that this looks like a clean code move in this version, without mutating this chunk in the previous patch. LGTM. -Stolee