git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: "git describe --debug" does not show the latest tag for "groff"
Date: Sat, 30 Oct 2021 23:15:14 +0000	[thread overview]
Message-ID: <20211030231514.GA1086559@rhi.hi.is> (raw)
In-Reply-To: <211028.86wnlxwnqt.gmgdl@evledraar.gmail.com>

On Thu, Oct 28, 2021 at 10:26:21AM +0200, Ævar Arnfjörð Bjarmason wrote:
> 
> On Wed, Oct 27 2021, Bjarni Ingi Gislason wrote:
> 
> > What did you do before the bug happened? (Steps to reproduce your issue)
> >
> >   I do not know, it could have happened anytime after the latest tag
> > was committed (11th Nov. 2020).
> >
> > What did you expect to happen? (Expected behavior)
> >
> >   Seeing the latest tag "1.23.0.rc1" in the version string of "groff"
> > (and in the output of "git describe --debug")
> >
> > What happened instead? (Actual behavior)
> >
> >   "groff --version" shows for example "1.22.4.3317-8f8c8-dirty"
> >
> >   "git describe --debug" shows:
> >
> > describe HEAD
> > No exact match on refs or tags, searching to describe
> > finished search at 2ac1f9ba5578cad27dc547d5be3c91753db436ea
> >  annotated       3318 1.22.4
> >  annotated       3319 1.22.4.rc5
> >  annotated       3352 1.22.4.rc4
> >  annotated       3464 1.22.4.rc3
> >  annotated       3485 1.23.0.rc1
> >  annotated       3572 1.22.4.rc2
> >  annotated       3619 1.22.3.rc1
> > traversed 3833 commits
> > 1.22.4-3318-g3a1e750d
> >
> > What's different between what you expected and what actually happened?
> >
> >   The latest tag is not shown for the groff version.
> >
> > Anything else you want to add:
> >
> >
> >   The latest tag in "git log" is 1.23.0.rc1 in my branch.
> >   It is 1.23.0.rc1 in branch master.
> >
> >   Search for "tag:" in "git log" in my branch shows:
> >
> > commit c05b538c504106d55b81caa6400ea80797f03775 (tag: 1.23.0.rc1)
> > Author: Bertrand Garrigues <...>
> > Date:   Wed Nov 11 01:58:55 2020 +0100
> >
> >   "git show-ref 1.23.0.rc1" in my branch shows:
> >
> > faa3dff8d011e61721e763c71b6ccbf20a4675bc refs/tags/1.23.0.rc1
> >
> > ####
> >
> >   "git-version-gen" (gnulib) does not get the latest tag.
> >
> >   The call in configure.am is:
> >
> > AC_INIT([GNU Troff],[m4_esyscmd(build-aux/git-version-gen --prefix ""
> > .tarball-version)],[http://savannah.gnu.org/bugs/?group=g$
> >
> >   The files ".git/packed-refs" and ".git/info/refs" are the same in both
> > branches.
> >
> > #####
> >
> > [System Info]
> > git version 2.33.0 (Debian/testing Version: 1:2.33.0-1)
> > cpu: x86_64
> > no commit associated with this build
> > sizeof-long: 8
> > sizeof-size_t: 8
> > shell-path: /bin/sh
> > uname: Linux 5.14.9-2 #1 SMP Sun Oct 10 01:53:44 UTC 2021 x86_64
> > compiler info: gnuc: 10.2
> > libc info: glibc: 2.32
> > $SHELL (typically, interactive shell): /bin/bash
> 
> Daginn.
> 
> The "git describe" command won't just return the latest tag name, but if
> you're not on such an exact tag name find the "closest", and then add a
> suffix indicating the distance and HEAD commit.
> 
> Reading between the lines I think you know that, but you're suprised
> that it's finding 1.22.4 instead of 1.23.0.rc1, which newer.
> 
> I tried to reproduce this and cloned
> https://git.savannah.gnu.org/git/groff.git; If you run e.g. this
> command:
>     
>     $ for c in $(git log --oneline 1.22.4..1.23.0.rc1 | awk '{print $1}'); do git describe $c; done
>     1.23.0.rc1
>     1.22.4-765-g10cd0b66
>     1.22.4-764-ge3b774ad
>     1.22.4-763-gfb52df3b
>     1.22.4-762-g0f42ca27
>     1.22.4-761-gdf73fc2b
>     1.22.4-760-g3afeb883
>     1.22.4-759-gcb1a9dc5
>     [...]
> 
> You'll see us describing all commits between 1.22.4..1.23.0-rc0, ending with:
>     
>     [...]
>     1.22.4-7-g72b4440e
>     1.22.4-6-g81908bc0
>     1.22.4-5-g9da68905
>     1.22.4-4-g2212cba0
>     1.22.4-3-ga3068bfd
>     1.22.4-2-g607236cc
>     1.22.4-1-gde9f9bfd
> 
> But as your tag "1.22.4.3317-8f8c8-dirty" shows we're at a distance of
> 3317 from 1.22.4. Are you able to share whatever your 8f8c8 is
> somewhere? I wonder if you're on some commit based off an older version.
> 
> Aside from what ref "describe" picked it's weird that a new version of
> git would choose to show a 5-character hex abbreviation of the commit,
> the minimum we show these days is 7, unless you have something setting
> e.g. this in config:
> 
>     core.abbrev=5
> 
> Or maybe that AC_INIT() macro does that somehow...

  The latest tagged version (1.23.0.rc1) is actually in the output of
"git describe --debug", but at the wrong place.

  "git log" on the console shows the tag "1.23.0.rc1" to be the first
one.

  "git log" directed to a file does not show any 'tag' in the commit
lines!

  "git describe" gets the sorting wrong.

  Part of output from "git log | grep '^commit [0-9a-f]' | cat -n":

     1	commit 3a1e750d2e03ed67eff01155ace01a0657c23ad7
     2	commit 8f8c8ab812093554ebdf3a3218c8944302c9eb94 <--
     3	commit 86b12aaaf5b7ceac78df11c53d3f45e1de0d8522
...
  1939	commit 2e52c43497d6078d1be3edf12aec962a91cb54e2
  1940	commit 2ca9c70def2b83cb5ad4cb5da0c0e2533a21b133
  1941	commit ab3e18c27ea1890bb98812a80d1e36c1c03f5db3
  1942	commit c05b538c504106d55b81caa6400ea80797f03775 <-- 1.23.0.rc1
  1943	commit 10cd0b662256d6fd2b6ed204f0ce891c8fc1175d
  1944	commit a4584886ce3391d85b6d1e2c774bf919cdd94451
...
  3004  commit a3068bfda2e25584e4d07781162179cb79829f56
  3005  commit 607236cc2ba834f326d01db189026f3dc28e118b
  3006  commit de9f9bfdf63245967bdbe56c503d587fcf0b279b
  3007  commit cc292790528abb8985c8b743ac3887f7f393cd7a <-- 1.22.4
  3008  commit 39cade0f09d9531d15abe7873101694cf0140ba4
  3009  commit 743c23c7f9d2a4e8f6e7cd555703487521dd012d
  3010  commit b78b8ba1a973421ad00770fc10bcd894fc7fc717
...
  6712	commit a48ab7b6db26b1d98f77f59f22896fe02a700c40
  6713	commit bd5385e4ea12522ba7e852fa3a628f3be854f674
  6714	commit 351da0dcdf702cf243d26ffa998961bce2aa8653

In ".git/info/refs" commit 1.23.0.rc1 is listed with an affix "^{}".

  Without an affix the commit is "faa3dff8...", which is not in the
output of "git log".

  The used expression of "git describe" uses "--abbrev=4" (in
git-version-gen) for generating version strings for "groff".

-- 
Bjarni I. Gislason

  reply	other threads:[~2021-10-30 23:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27 23:31 "git describe --debug" does not show the latest tag for "groff" Bjarni Ingi Gislason
2021-10-28  8:26 ` Ævar Arnfjörð Bjarmason
2021-10-30 23:15   ` Bjarni Ingi Gislason [this message]
2021-10-31  0:12     ` Chris Torek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211030231514.GA1086559@rhi.hi.is \
    --to=bjarniig@rhi.hi.is \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).