git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] describe: count the distance correctly when commit dates are skewed

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 4, 2026, 18:17 UTC
Message-ID
<xmqqv76c1mwb.fsf@gitster.g>
In-Reply-To
<CAL71e4PqEQkGoont3tL5wJWd1_itsaaxfX+DOkLj64x-S7xR1A@mail.gmail.com>
Kristofer Karlsson <krka@spotify.com> writes:
Show 6 quoted lines
> 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.

Show 21 quoted lines
> 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.
Previous: Kristofer KarlssonNext: Linus Torvalds
Message 16 of 17 in “describe: count the distance correctly when commit dates are skewed”
  1. describe: count the distance correctly when commit dates are skewedLinus Torvalds, Oct 31, 2026
  2. Tuomas AholaOct 31, 2026
  3. Junio C HamanoNov 1, 2026
  4. Tuomas AholaNov 1, 2026
  5. Junio C HamanoNov 1, 2026
  6. SZEDER GáborNov 2, 2026
  7. Patrick SteinhardtNov 2, 2026
  8. Derrick StoleeNov 2, 2026
  9. Junio C HamanoNov 2, 2026
  10. Derrick StoleeNov 2, 2026
  11. Linus TorvaldsNov 2, 2026
  12. Patrick SteinhardtNov 3, 2026
  13. Linus TorvaldsNov 3, 2026
  14. Junio C HamanoNov 4, 2026
  15. Kristofer KarlssonNov 4, 2026
  16. Junio C HamanoNov 4, 2026
  17. Linus TorvaldsNov 4, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.