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

5 messages from 2024-01-30 to 2024-02-06. Participants: Junio C Hamano, Eric Sunshine, Martin Ågren.
Thread: https://gitlist.dev/t/60818

## Junio C Hamano, 2024-01-30 19:03

Subject: [PATCH] t0091: allow test in a repository without tags
Message-ID: <xmqqv87aabk3.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqv87aabk3.fsf%40gitster.g

```
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(-)

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, 2024-01-30 20:53

Subject: Re: [PATCH] t0091: allow test in a repository without tags
Message-ID: <CAPig+cSmSjifRXsotTrdjjFsh0N4w+BzbZXKffPyn_rpirBVUw@mail.gmail.com>
URL: https://gitlist.dev/e/CAPig%2BcSmSjifRXsotTrdjjFsh0N4w%2BBzbZXKffPyn_rpirBVUw%40mail.gmail.com
In-Reply-To: <xmqqv87aabk3.fsf@gitster.g>

```
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, 2024-01-30 21:46

Subject: Re: [PATCH] t0091: allow test in a repository without tags
Message-ID: <xmqqmssma413.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqmssma413.fsf%40gitster.g
In-Reply-To: <CAPig+cSmSjifRXsotTrdjjFsh0N4w+BzbZXKffPyn_rpirBVUw@mail.gmail.com>

```
Eric Sunshine <sunshine@sunshineco.com> writes:

> 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, 2024-02-05 10:07

Subject: Re: [PATCH] t0091: allow test in a repository without tags
Message-ID: <CAN0heSrX8zQnfk_abtgBreoc=a8Z+7E-jEHHUFmu6740L8p2Lw@mail.gmail.com>
URL: https://gitlist.dev/e/CAN0heSrX8zQnfk_abtgBreoc%3Da8Z%2B7E-jEHHUFmu6740L8p2Lw%40mail.gmail.com
In-Reply-To: <xmqqv87aabk3.fsf@gitster.g>

```
On Tue, 30 Jan 2024 at 20:03, 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
> 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, 2024-02-06 18:33

Subject: Re: [PATCH] t0091: allow test in a repository without tags
Message-ID: <xmqqeddpigsm.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqeddpigsm.fsf%40gitster.g
In-Reply-To: <CAN0heSrX8zQnfk_abtgBreoc=a8Z+7E-jEHHUFmu6740L8p2Lw@mail.gmail.com>

```
Martin Ågren <martin.agren@gmail.com> writes:

> 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.

>
>> -       # 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

```
