From: Junio C Hamano <gitster@pobox.com>
To: Kristofer Karlsson <krka@spotify.com>
Cc: Patrick Steinhardt <ps@pks.im>,
Linus Torvalds <torvalds@linux-foundation.org>,
git@vger.kernel.org
Subject: Re: [PATCH] describe: count the distance correctly when commit dates are skewed
Date: Thu, 05 Nov 2026 09:28:47 -0800 [thread overview]
Message-ID: <xmqqy0b7w5kg.fsf@gitster.g> (raw)
In-Reply-To: <CAL71e4Pp=rZSKd+vC9anjEVHS=a6DOoK-HC_Z+3vDaqjo0+6+Q@mail.gmail.com> (Kristofer Karlsson's message of "Thu, 5 Nov 2026 16:42:29 +0100")
Kristofer Karlsson <krka@spotify.com> writes:
> I have a series locally that builds on top of this topic
> (lt/describe-commit-date-skew), and while working on it I
> noticed that the topic makes an expected failure pass in the
> commit-graph test mode, which fails the test script:
>
> $ cd t && GIT_TEST_COMMIT_GRAPH=1 ./t6120-describe.sh
> [...]
> ok 102 - describe --candidates=2 HEAD # TODO known breakage vanished
> [...]
> # 1 known breakage(s) vanished; please update test(s)
Yes, that is exactly the one I pointed out passing in CI in a few
message upthread.
> That test now passes when a commit-graph has been written for
> it, which GIT_TEST_COMMIT_GRAPH does, but still fails without
> one, so it cannot just be flipped. I think Linus's patch is
> good, but it needs something like this squashed in. My series
> would remove the unset again once the test passes in both
> modes.
Perhaps.
We'd want these tests to pass whether we have commit-graph or not
(in other words, the presence of commit-graph should not affect
correctness but only performance in an ideal world), but we live in
an imperfect world, so as a stop-gap measure I think it is OK to only
test in one single setting, even though I would really prefer to
test both with and without the feature, and have all tests pass.
Short of that, it would be better to test only the "default"
case. Since mid-2019, core.commitGraph defaults to true, so it may
make sense to use the same trick as your patch below but freeze the
setting to always test this feature under GIT_TEST_COMMIT_GRAPH
instead. It would require flipping one expect_failure to
expect_success in the case involved, though.
> -- >8 --
> Subject: t6120: keep disjoint history out of the commit-graph
>
> With commits walked in generation number order, the
> "--candidates=2" test for disjoint histories passes when a
> commit-graph exists, which GIT_TEST_COMMIT_GRAPH=1 writes, but
> still fails without one. Keep that history out of the
> commit-graph so the expected failure holds in both cases.
>
> Signed-off-by: Kristofer Karlsson <krka@spotify.com>
> ---
> t/t6120-describe.sh | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh
> index a75f9227d9..969f878946 100755
> --- a/t/t6120-describe.sh
> +++ b/t/t6120-describe.sh
> @@ -704,6 +704,10 @@ test_expect_success 'setup: describe commits with
> disjoint bases' '
> git init disjoint1 &&
> (
> cd disjoint1 &&
> + # describe walks this history differently with a
> + # commit-graph, so always test it without one,
> + # whatever GIT_TEST_COMMIT_GRAPH says
> + sane_unset GIT_TEST_COMMIT_GRAPH &&
>
> echo o >> file && git add file && git commit -m o &&
> git tag H -a -m H &&
prev parent reply other threads:[~2026-11-05 17:28 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-31 6:55 [PATCH] describe: count the distance correctly when commit dates are skewed Linus Torvalds
2026-10-31 12:31 ` Tuomas Ahola
2026-11-01 1:07 ` Junio C Hamano
2026-11-01 9:46 ` Tuomas Ahola
2026-11-01 18:12 ` Junio C Hamano
2026-11-02 6:17 ` SZEDER Gábor
2026-11-02 12:46 ` Patrick Steinhardt
2026-11-02 14:20 ` Derrick Stolee
2026-11-02 17:03 ` Junio C Hamano
2026-11-02 17:52 ` Derrick Stolee
2026-11-02 18:37 ` Linus Torvalds
2026-11-03 7:16 ` Patrick Steinhardt
2026-11-03 15:58 ` Linus Torvalds
2026-11-04 0:34 ` Junio C Hamano
2026-11-04 11:01 ` Kristofer Karlsson
2026-11-04 18:17 ` Junio C Hamano
2026-11-04 18:29 ` Linus Torvalds
2026-11-05 15:42 ` Kristofer Karlsson
2026-11-05 17:28 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqy0b7w5kg.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=krka@spotify.com \
--cc=ps@pks.im \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.