]> git.ipfire.org Git - thirdparty/git.git/commit
commit-graph: avoid repeated mixed generation number warnings
authorTaylor Blau <me@ttaylorr.com>
Mon, 21 Aug 2023 21:34:42 +0000 (17:34 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 21 Aug 2023 23:16:23 +0000 (16:16 -0700)
commitdb6044d76261a996c03ce8f1e08240f326a42e15
treef1856b8ba2fb03970529f8defd4762d87646541f
parentce7629a315459c12451ee9071db22f8b0e26a4eb
commit-graph: avoid repeated mixed generation number warnings

When validating that a commit-graph has either all zero, or all non-zero
generation numbers, we emit a warning on both the rising and falling
edge of transitioning between the two.

So if we are unfortunate enough to see a commit-graph which has a
repeating sequence of zero, then non-zero generation numbers, we'll
generate many warnings that contain more or less the same information.

Avoid this by keeping track of a single example for a commit with zero-
and non-zero generation, and emit a single warning at the end of
verification if both are non-NULL.

Co-authored-by: Jeff King <peff@peff.net>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit-graph.c
t/t5318-commit-graph.sh