Re: [PATCH v4 8/8] commit-reach: move min_generation check into paint_queue_get()
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Jun 28, 2026, 15:15 UTC
- Message-ID
- <f77c0834-a001-400d-a8b8-a1e2398bf574@gmail.com>
- In-Reply-To
- <8dd15d44e6a60fc39bbf6d894628507e839f9248.1782649547.git.gitgitgadget@gmail.com>
On 6/28/26 8:25 AM, Kristofer Karlsson via GitGitGadget wrote:
> From: Kristofer Karlsson <krka@spotify.com>
...> @@ -138,11 +140,23 @@ static void paint_queue_put(struct paint_state *state,
Show 20 quoted lines
> 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;...
Show 8 quoted lines
> - 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