Subject: bug#63775: closed (Re: bug#63775: git describe on current master says: v1.3.0-38775-g6192acf8b7)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 03 Feb 2024 18:44:02 +0000

Your bug report

#63775: git describe on current master says: v1.3.0-38775-g6192acf8b7

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
63775: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63775
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#63775: git describe on current master says: v1.3.0-38775-g6192acf8b7
From: Giovanni Biscuolo <[email-masked]>
To: Jonathan Brielmaier <[email-masked]>, [email-masked]
Cc: [email-masked], Simon Tournier <[email-masked]>
Date: Sat, 03 Feb 2024 19:43:14 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Jonathan,

I'm CC'ing guix-devel because I suspect many users who cloned/updated
the Guix repo are having the same results... and concerns.

This is a git bug, not an issue with our repo, and for this reason (I
hope) I'm closing this bug; please see below.

Jonathan Brielmaier via Bug reports for GNU Guix <[email-masked]>
writes:

> Hm, I'm hitting this bug while trying to work on the openSUSE package.
> They offer a way to build RPM packages from the most recent master
> commit, but it's get the wrong version (1.3.0 instead of 1.4.0) due to
> this `git describe` result.

As pointed out by Simon last June the result of "git describe" is not
what users should get given the "Search strategy" documented in the
command manual: https://git-scm.com/docs/git-describe#_search_strategy:

--8<---------------cut here---------------start------------->8---

If multiple tags were found during the walk then the tag which has the
fewest commits different from the input commit-ish will be selected and
output. Here fewest commits different is defined as the number of
commits which would be shown by git log tag..input will be the smallest
number of commits possible.

--8<---------------cut here---------------end--------------->8---

The upstream bug report (and a reproducer) is this one:
«Subject: [BUG] `git describe` doesn't traverse the graph in topological
order»
https://lore.kernel.org/git/ZNffWAgldUZdpQcr@farprobe/

Another user also reported the issue and a reproducer:
https://public-inbox.org/git/[email-masked]/

The "executive summary" is that "git describe" gets the count of "fewest
commits different from the input commit-ish" wrong (see anso previous
messages in this thread for details).

Anyway, even if this bug was solved, I'd warmly suggest NOT to base the
check for the latest stable Guix commit (usually tagged as v[0-9]*) on
the result of "git describe".

Today, if "guix describe" had no bugs, the correct result would be:
"base-for-issue-62196"... AFAIU :-)

This is a reproducer:

--8<---------------cut here---------------start------------->8---

$ git describe $(git rev-list --tags --max-count=1)
base-for-issue-62196

--8<---------------cut here---------------end--------------->8---

To get the value corresponding to the latest tagged version, we should
testrict the list of tags to the ones matching the "v[0-9]*" regexp:

--8<---------------cut here---------------start------------->8---

$ git describe $(git rev-list --tags="v[0-9]*" --max-count=1)
v1.4.0

--8<---------------cut here---------------end--------------->8---

To browse all the tags there is the "git tag" command, for example to
have the list and description of every Guix released version:

--8<---------------cut here---------------start------------->8---

$ git tag -l "v[0-9]*" --sort=-creatordate -n
v1.4.0          GNU Guix 1.4.0.
v1.4.0rc2       GNU Guix 1.4.0rc2.
v1.4.0rc1       GNU Guix 1.4.0rc1.
v1.3.0          GNU Guix 1.3.0.
v1.3.0rc2       GNU Guix 1.3.0rc2.
v1.3.0rc1       GNU Guix 1.3.0rc1.
v1.2.0          GNU Guix 1.2.0.
v1.2.0rc2       GNU Guix 1.2.0rc2.
v1.2.0rc1       GNU Guix 1.2.0rc1.
v1.1.0          GNU Guix 1.1.0.
v1.1.0rc2       GNU Guix 1.1.0rc2.
v1.1.0rc1       GNU Guix 1.1.0rc1.
v1.0.1          GNU Guix 1.0.1.
v1.0.0          GNU Guix 1.0.0.
v0.16.0         GNU Guix 0.16.0.
v0.15.0         GNU Guix 0.15.0.
v0.14.0         GNU Guix 0.14.0.
v0.13.0         GNU Guix 0.13.0.
v0.12.0         GNU Guix 0.12.0
v0.11.0         GNU Guix 0.11.0.
v0.10.0         GNU Guix 0.10.0.
v0.9.0          GNU Guix 0.9.0.
v0.8.3          GNU Guix 0.8.3.
v0.8.2          GNU Guix 0.8.2.
v0.8.1          GNU Guix 0.8.1.
v0.8            GNU Guix 0.8.
v0.7            GNU Guix 0.7.
v0.6            GNU Guix 0.6.
v0.5            GNU Guix 0.5.
v0.4            GNU Guix 0.4.
v0.3            GNU Guix 0.3.
v0.2            GNU Guix 0.2.
v0.1            GNU Guix 0.1.
v0.0            Guix 0.0, initial announcement.

--8<---------------cut here---------------end--------------->8---

HTH!

Happy hacking, Gio'

-- 
Giovanni Biscuolo

Xelera IT Infrastructures

Subject: git describe on current master says: v1.3.0-38775-g6192acf8b7
From: Janneke Nieuwenhuizen <[email-masked]>
To: [email-masked]
Date: Sun, 28 May 2023 17:16:08 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi!

Subject says it all:

--8<---------------cut here---------------start------------->8---
17:12:25 janneke@drakenpad:~/src/guix/master [env]
$ git fetch origin
17:12:56 janneke@drakenpad:~/src/guix/master [env]
$ git fetch origin --tags
17:13:04 janneke@drakenpad:~/src/guix/master [env]
$ git reset --hard origin/master
HEAD is now at 6192acf8b7 gnu: telegram-desktop: Update to 4.8.1
17:13:09 janneke@drakenpad:~/src/guix/master [env]
$ git describe
v1.3.0-38775-g6192acf8b7
--8<---------------cut here---------------end--------------->8---

(There was a question on IRC by cassio: "How do I upgrade to 1.4",
 but I don't see it in the channel logs yet).

Greetings,
Janneke

-- 
Janneke Nieuwenhuizen <[email-masked]>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com