"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Christian Weisgerber <naddy@mips.inka.de>
Subject:
got 2.56 breaks blame.sh tests
To:
gameoftrees@openbsd.org
Date:
Fri, 16 Oct 2026 17:55:14 +0200

Download raw body.

Thread
  • Christian Weisgerber:

    got 2.56 breaks blame.sh tests

git 2.56.0 has introduced an incompatible change that breaks the
blame_cmp() comparison in regress/cmdline/blame.sh.  Previously,
the minimum width of an abbreviated commit hash was interpreted as
n+1 characters.  With the default minimum of 7:

0bab3ae3 (Flan Hacker 2026-10-16 15:27:49 +0000 1) 1
361741de (Flan Hacker 2026-10-16 15:27:49 +0000 2) 2
7b71ed01 (Flan Hacker 2026-10-16 15:27:49 +0000 3) 3

Now it is interpreted as n:

0bab3ae (Flan Hacker 2026-10-16 15:27:49 +0000 1) 1
361741d (Flan Hacker 2026-10-16 15:27:49 +0000 2) 2
7b71ed0 (Flan Hacker 2026-10-16 15:27:49 +0000 3) 3

Unfortunately, this also extends to --abbrev=n, so while --abbrev=8
fixes the tests for git >=2.56, it breaks them for <2.56.

Tentative fix that works on both sides of the divide:

diff /home/naddy/got
path + /home/naddy/got
commit - f9aa12d03cfa44b2606f3ddebe8783c08c8a1d0a
blob - d029636f37e1e06a4fba931a86782da565457b03
file + regress/cmdline/blame.sh
--- regress/cmdline/blame.sh
+++ regress/cmdline/blame.sh
@@ -24,7 +24,8 @@ blame_cmp() {
 	(cd $testroot/wt && got blame "$file" | cut -d ' ' -f 2 \
 		> $testroot/${file}.blame.got)
 	git -C $testroot/repo reset --hard master > /dev/null
-	git -C $testroot/repo blame "$file" | cut -d ' ' -f 1 \
+	# git <2.56 outputs n+1 characters
+	git -C $testroot/repo blame --abbrev=8 "$file" | cut -c1-8 \
 		> $testroot/${file}.blame.git
 
 	cmp -s $testroot/${file}.blame.git $testroot/${file}.blame.got
-- 
Christian "naddy" Weisgerber                          naddy@mips.inka.de