threads / patch / 60818

patcht0091: allow test in a repository without tags

Subject: [PATCH] t0091: allow test in a repository without tags

## tl;dr

5 messages between Jan 30, 2024 and Feb 6, 2024. Diffs are folded; open one to read it.

replies: 4people: 3as markdown or json

Junio C Hamano· Jan 30, 2024, 19:03 UTC · lore

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.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t0091-bugreport.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Show changes to diff +2 −2
diff --git c/t/t0091-bugreport.sh w/t/t0091-bugreport.sh
index 8798feefe3..fca39048fe 100755
--- c/t/t0091-bugreport.sh
+++ w/t/t0091-bugreport.sh
@@ -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.
Eric Sunshine· Jan 30, 2024, 20:53 UTC · re: Junio C Hamano · lore

Re: [PATCH] t0091: allow test in a repository without tags

On Tue, Jan 30, 2024 at 2:03 PM Junio C Hamano <gitster@pobox.com> wrote:
> 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/
> without tags, for example, "git version unknown.g00000000" can be a
> legit version string.
>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano· Jan 30, 2024, 21:46 UTC · re: Eric Sunshine · lore

Re: [PATCH] t0091: allow test in a repository without tags

Eric Sunshine <sunshine@sunshineco.com> writes:
Show 6 quoted lines
> On Tue, Jan 30, 2024 at 2:03 PM Junio C Hamano <gitster@pobox.com> wrote:
>> 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.
Martin Ågren· Feb 5, 2024, 10:07 UTC · re: Junio C Hamano · lore

Re: [PATCH] t0091: allow test in a repository without tags

On Tue, 30 Jan 2024 at 20:03, Junio C Hamano <gitster@pobox.com> wrote:
Show 6 quoted lines
>
> 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.

> -       # 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.
>         # but rather than checking bit-for-bit equality, just test some basics.
> -       grep "git version [0-9]." system &&
> +       grep "git version " system &&
This matches the commit message, ok.
Martin
Junio C Hamano· Feb 6, 2024, 18:33 UTC · re: Martin Ågren · lore

Re: [PATCH] t0091: allow test in a repository without tags

Martin Ågren <martin.agren@gmail.com> writes:
Show 5 quoted lines
> 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.

Show 13 quoted lines
>
>> -       # 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.
>
>>         # but rather than checking bit-for-bit equality, just test some basics.
>> -       grep "git version [0-9]." system &&
>> +       grep "git version " system &&
>
> This matches the commit message, ok.
>
> Martin

← back to recent threads