From: Patrick Steinhardt <ps@pks.im>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] describe: count the distance correctly when commit dates are skewed
Date: Tue, 3 Nov 2026 08:16:45 +0100 [thread overview]
Message-ID: <aumKXUS7_x0i7ZU1@pks.im> (raw)
In-Reply-To: <CAHk-=wijLfduoJyOM+AW6FS6c02cuEFRAuQWLE+uf7SGhj8jXA@mail.gmail.com>
On Mon, Nov 02, 2026 at 10:37:57AM -0800, Linus Torvalds wrote:
> On Mon, 2 Nov 2026 at 04:47, Patrick Steinhardt <ps@pks.im> wrote:
> > Hmm. The big downside of this particular change is that you may now get
> > different results depending on whether or not you have a recent commit
> > graph. So you may get different results based on when git-maintenance(1)
> > last decided to update it, and that would in turn result in highly
> > puzzling behaviour for the end user.
>
> Well, honestly, no more puzzling than the odd existing behavior. But:
>
> > ... I wonder whether we should also call `ensure_generations_valid()`
> > here.
>
> I suspect that is just *way* too expensive in the bad case, but I
> would hope/assume that any big repo already has generation numbers in
> it, so maybe it doesn't matter.
We nowadays generate commit graphs by default, yes. So usually
repositories should have one, but there will of course be outliers where
they don't exist because of whatever reason.
> Maybe add a "--exact" flag ot something to force it, and just document
> that without it, you can get slightly odd numbers.
>
> Becasue rigth now, the numbers may be consistent, but when they can be
> consistently *wrong*, I don't think that's a good thing either. It
> took me a week of annoyance to even start looking at *why* they were
> wrong.
I fully agree that being consistently wrong isn't great. I just wonder
whether being intermittently wrong is even worse because now the actual
result depends on timing. And consequently I'm a bit hesitant to
introduce an "--exact" flag and have people opt-in to a consistently
correct result, because they won't even know that git-describe(1) may by
default produce incorrect results.
An alternative that might be worth considering here is to instead make
users opt-out with "--no-exact", and then make that discoverable by
emitting a warning in the case where we don't have a commit graph in the
repository.
Patrick
next prev parent reply other threads:[~2026-11-03 7:16 UTC|newest]
Thread overview: 17+ 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 [this message]
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
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=aumKXUS7_x0i7ZU1@pks.im \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox