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


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

  reply	other threads:[~2021-10-28  8:35 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 [this message]
2021-10-30 23:15   ` Bjarni Ingi Gislason
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=211028.86wnlxwnqt.gmgdl@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=bjarniig@rhi.hi.is \
    --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).