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: Wed, 04 Nov 2026 10:17:56 -0800 [thread overview]
Message-ID: <xmqqv76c1mwb.fsf@gitster.g> (raw)
In-Reply-To: <CAL71e4PqEQkGoont3tL5wJWd1_itsaaxfX+DOkLj64x-S7xR1A@mail.gmail.com> (Kristofer Karlsson's message of "Wed, 4 Nov 2026 12:01:58 +0100")
Kristofer Karlsson <krka@spotify.com> writes:
> What remains is knowing when to stop. With the queue ordered by
> generation number, as in Linus's patch, that is exact for commits in
> the commit-graph. For commits outside of it, it is exact as long as
> no commit is dated more than some epsilon before one of its own
> ancestors. That is a sufficient condition, not a necessary one: on
> linux.git the worst such case since v6.0 is about 60 days, but a
Unbelievably bad clock skew. I wonder if these people do not check
their machine clock at all, but knowing the answer to that or learning
why they don't would not help the issue at hand at all, so I'll stop.
> miscount also needs the skew to be right where the walk stops, and
> an epsilon of a week gave exact depths for every commit I tried,
> including the ones right around the skewed spots, at no measurable
> cost.
>
> A nice property is that this also works well with a partial
> commit-graph. The commits outside of it are visited first, and only
> those rely on the epsilon; once the walk reaches the commits in it,
> it can stop as soon as the depths are final. So the commit-graph
> does not need to be fully up to date to help, much like with other
> walks that use generation numbers.
>
> For 2a500a04d6f9 it gives v7.3-19059 with and without a
> commit-graph, in about the same time as master, and it matches
> "rev-list --count" on the ~450 commits of the last merge window.
> Both expected failures in t6120 pass with it, with and without
> GIT_TEST_COMMIT_GRAPH. The change is about 120 lines added and 60
> removed in builtin/describe.c.
>
> Would this be worth pursuing, either instead of or on top of
> Linus's patch? If so, I would be happy to clean it up and send it.
Sounds interesting to me.
Thanks.
next prev parent reply other threads:[~2026-11-04 18:17 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 [this message]
2026-11-04 18:29 ` Linus Torvalds
2026-11-05 15:42 ` Kristofer Karlsson
2026-11-05 17:28 ` Junio C Hamano
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=xmqqv76c1mwb.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.