Skip to contentSkip to conversation

t0091: allow test in a repository without tags

PATCH In review Junio C Hamano 3 participants 5 messages Jan 30, 2024 – Feb 6, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 t0091: allow test in a repository without tags

The beginning of the [System Info] section, which should match the "git version --build-options" output, may not identify our version as "git version 2.whatever". When build in a repository cloned without tags, for example, "git version unknown.g00000000" can be a legit version string.

---
 t/t0091-bugreport.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
t/t0091-bugreport.sh +2 -2
index 8798feefe3..fca39048fe 100755
@@ -39,9 +39,9 @@ test_expect_success 'sanity check "System Info" section' '
 
 	sed -ne "/^\[System Info\]$/,/^$/p" <git-bugreport-format.txt >system &&
 
-	# The beginning should match "git version --build-info" verbatim,
+	# The beginning should match "git version --build-options" verbatim,
 	# but rather than checking bit-for-bit equality, just test some basics.
-	grep "git version [0-9]." system &&
+	grep "git version " system &&
 	grep "shell-path: ." system &&
 
 	# After the version, there should be some more info.
#1 lore raw
Quoted 3 lines · Junio C Hamano

The beginning of the [System Info] section, which should match the "git version --build-options" output, may not identify our version as "git version 2.whatever". When build in a repository cloned

s/build/built/

Quoted 4 lines

without tags, for example, "git version unknown.g00000000" can be a legit version string.

#2 lore raw
Quoted 6 lines · Eric Sunshine
Quoted 3 lines · Junio C Hamano

The beginning of the [System Info] section, which should match the "git version --build-options" output, may not identify our version as "git version 2.whatever". When build in a repository cloned

s/build/built/

Thanks.

#3 lore raw
In reply to Junio C Hamano
Quoted 6 lines · Junio C Hamano

The beginning of the [System Info] section, which should match the "git version --build-options" output, may not identify our version as "git version 2.whatever". When build in a repository cloned without tags, for example, "git version unknown.g00000000" can be a legit version string.

I've tried reproducing this along the lines of

  git clone --no-tags <url>
  cd git
  make
  (cd t && ./t0091-*)

but this works for me on current master, 2a540e432f ("The thirteenth batch", 2024-02-02), which doesn't have this patch.

GIT-VERSION-GEN seems to be careful to only use tags on the wanted form. My build generates a git version of "2.43.GIT", no "unknown..." stuff.

I don't doubt that you've hit this, I just wonder which piece of the puzzle I'm missing.

t/t0091-bugreport.sh test_expect_success 'sanity check "System Info" section' ' · line 42

Quoted 2 lines
t/t0091-bugreport.sh +1 -1
-       # The beginning should match "git version --build-info" verbatim,
+       # The beginning should match "git version --build-options" verbatim,

Correct, my thinko-typo, thanks for correcting.

t/t0091-bugreport.sh test_expect_success 'sanity check "System Info" section' ' · line 44

Quoted 3 lines
        # but rather than checking bit-for-bit equality, just test some basics.
t/t0091-bugreport.sh +1 -1
-       grep "git version [0-9]." system &&
+       grep "git version " system &&

This matches the commit message, ok.

Martin

#4 lore raw
Quoted 5 lines · Martin Ågren

GIT-VERSION-GEN seems to be careful to only use tags on the wanted form. My build generates a git version of "2.43.GIT", no "unknown..." stuff.

I don't doubt that you've hit this, I just wonder which piece of the puzzle I'm missing.

I wonder that too.

I was experimenting with "seen" with the reftable. I first created a new and empty repository with "git init --ref-format=reftable" in a brand new directory next to my primary working area, and then did "git fetch --no-tags ../git.git/ master" or something to pull the history without tags in. After that I thought I was careful to make sure I only ran the "seen" version of Git (all my other installations of Git are unaware of reftable, and the version of Git on my regular $PATH is not from the "seen" branch), but perhaps I screwed up at some point and the mistake got stuck in the version file, or something silly like that, perhaps.

Quoted 13 lines

t/t0091-bugreport.sh test_expect_success 'sanity check "System Info" section' ' · line 42

Quoted 3 lines
t/t0091-bugreport.sh +1 -1
-       # The beginning should match "git version --build-info" verbatim,
+       # The beginning should match "git version --build-options" verbatim,

Correct, my thinko-typo, thanks for correcting.

t/t0091-bugreport.sh test_expect_success 'sanity check "System Info" section' ' · line 44

Quoted 3 lines
        # but rather than checking bit-for-bit equality, just test some basics.
t/t0091-bugreport.sh +1 -1
-       grep "git version [0-9]." system &&
+       grep "git version " system &&

This matches the commit message, ok.

Martin