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
SZEDER Gábor <szeder.dev@gmail.com>
Date
Nov 2, 2026, 06:17 UTC
Message-ID
<augrFe35Zci2mG+j@szeder.dev>
In-Reply-To
<xmqqa4nt2wch.fsf@gitster.g>
On Sat, Oct 31, 2026 at 06:07:10PM -0700, Junio C Hamano wrote:
Show 31 quoted lines
> Tuomas Ahola <taahol@utu.fi> writes:
> 
> > Linus Torvalds <torvalds@kernel.org> wrote:
> >
> >> +test_expect_success 'setup: describe a tag dated before its parent' '
> >> +	git init skew &&
> >> +	(
> >> +		cd skew &&
> >> +		git config core.commitGraph true &&
> >> +		test_commit --date "2020-01-01 18:00" base &&
> >> +		test_commit --date "2020-01-01 18:01" o &&
> >> +		test_commit --annotate --date "2020-01-01 17:01" T &&
> >> +		git checkout -b side o &&
> >> +		test_commit --date "2020-01-01 18:02" B &&
> >> +		git checkout main &&
> >> +		GIT_COMMITTER_DATE="2020-01-01 18:03" git merge --no-ff -m x side &&
> >> +		git commit-graph write --reachable
> >> +	)
> >> +'
> >
> > Just a clueless rewrite of the above.  I had quite fun writing it, so why not
> > to share... it works and might even offer some not-completely-bogus food for
> > thought.
> >
> > 	git init skew &&
> > 	(
> > 		cd skew &&
> > 		test_config core.commitGraph true &&
> 
> Doesn't this barf when it tries to register a clean-up action from
> inside a subshell?

In both cases this is a freshly initialized repository, and the commit graph has been enabled by default for a long time, so why do we need to set this config in the first place?

Previous: Junio C Hamano
Message 6 of 6 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

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.