{"thread":{"id":"56798","subject":"\"git describe --debug\" does not show the latest tag for \"groff\"","startedAt":"2021-10-27T23:44:12Z","lastAt":"2021-10-31T00:12:28Z","messageCount":4,"participants":["Bjarni Ingi Gislason","Ævar Arnfjörð Bjarmason","Chris Torek"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"439845","messageId":"20211027233101.GA762862@rhi.hi.is","threadId":"56798","inReplyTo":null,"subject":"\"git describe --debug\" does not show the latest tag for \"groff\"","fromName":"Bjarni Ingi Gislason","fromEmail":"bjarniig@rhi.hi.is","sentAt":"2021-10-27T23:31:01Z","receivedAt":"2021-10-27T23:44:12Z","isPatch":false,"sender":{"key":"bjarniig@rhi.hi.is","avatar":null},"body":"What did you do before the bug happened? (Steps to reproduce your issue)\n\n  I do not know, it could have happened anytime after the latest tag\nwas committed (11th Nov. 2020).\n\nWhat did you expect to happen? (Expected behavior)\n\n  Seeing the latest tag \"1.23.0.rc1\" in the version string of \"groff\"\n(and in the output of \"git describe --debug\")\n\nWhat happened instead? (Actual behavior)\n\n  \"groff --version\" shows for example \"1.22.4.3317-8f8c8-dirty\"\n\n  \"git describe --debug\" shows:\n\ndescribe HEAD\nNo exact match on refs or tags, searching to describe\nfinished search at 2ac1f9ba5578cad27dc547d5be3c91753db436ea\n annotated       3318 1.22.4\n annotated       3319 1.22.4.rc5\n annotated       3352 1.22.4.rc4\n annotated       3464 1.22.4.rc3\n annotated       3485 1.23.0.rc1\n annotated       3572 1.22.4.rc2\n annotated       3619 1.22.3.rc1\ntraversed 3833 commits\n1.22.4-3318-g3a1e750d\n\nWhat's different between what you expected and what actually happened?\n\n  The latest tag is not shown for the groff version.\n\nAnything else you want to add:\n\n\n  The latest tag in \"git log\" is 1.23.0.rc1 in my branch.\n  It is 1.23.0.rc1 in branch master.\n\n  Search for \"tag:\" in \"git log\" in my branch shows:\n\ncommit c05b538c504106d55b81caa6400ea80797f03775 (tag: 1.23.0.rc1)\nAuthor: Bertrand Garrigues <...>\nDate:   Wed Nov 11 01:58:55 2020 +0100\n\n  \"git show-ref 1.23.0.rc1\" in my branch shows:\n\nfaa3dff8d011e61721e763c71b6ccbf20a4675bc refs/tags/1.23.0.rc1\n\n####\n\n  \"git-version-gen\" (gnulib) does not get the latest tag.\n\n  The call in configure.am is:\n\nAC_INIT([GNU Troff],[m4_esyscmd(build-aux/git-version-gen --prefix \"\"\n.tarball-version)],[http://savannah.gnu.org/bugs/?group=g$\n\n  The files \".git/packed-refs\" and \".git/info/refs\" are the same in both\nbranches.\n\n#####\n\n[System Info]\ngit version 2.33.0 (Debian/testing Version: 1:2.33.0-1)\ncpu: x86_64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: Linux 5.14.9-2 #1 SMP Sun Oct 10 01:53:44 UTC 2021 x86_64\ncompiler info: gnuc: 10.2\nlibc info: glibc: 2.32\n$SHELL (typically, interactive shell): /bin/bash\n\n\n[Enabled Hooks]\n\n\n-- \nBjarni I. Gislason\n"},{"id":"439864","messageId":"211028.86wnlxwnqt.gmgdl@evledraar.gmail.com","threadId":"56798","inReplyTo":"20211027233101.GA762862@rhi.hi.is","subject":"Re: \"git describe --debug\" does not show the latest tag for \"groff\"","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-10-28T08:26:21Z","receivedAt":"2021-10-28T08:35:29Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Wed, Oct 27 2021, Bjarni Ingi Gislason wrote:\n\n> What did you do before the bug happened? (Steps to reproduce your issue)\n>\n>   I do not know, it could have happened anytime after the latest tag\n> was committed (11th Nov. 2020).\n>\n> What did you expect to happen? (Expected behavior)\n>\n>   Seeing the latest tag \"1.23.0.rc1\" in the version string of \"groff\"\n> (and in the output of \"git describe --debug\")\n>\n> What happened instead? (Actual behavior)\n>\n>   \"groff --version\" shows for example \"1.22.4.3317-8f8c8-dirty\"\n>\n>   \"git describe --debug\" shows:\n>\n> describe HEAD\n> No exact match on refs or tags, searching to describe\n> finished search at 2ac1f9ba5578cad27dc547d5be3c91753db436ea\n>  annotated       3318 1.22.4\n>  annotated       3319 1.22.4.rc5\n>  annotated       3352 1.22.4.rc4\n>  annotated       3464 1.22.4.rc3\n>  annotated       3485 1.23.0.rc1\n>  annotated       3572 1.22.4.rc2\n>  annotated       3619 1.22.3.rc1\n> traversed 3833 commits\n> 1.22.4-3318-g3a1e750d\n>\n> What's different between what you expected and what actually happened?\n>\n>   The latest tag is not shown for the groff version.\n>\n> Anything else you want to add:\n>\n>\n>   The latest tag in \"git log\" is 1.23.0.rc1 in my branch.\n>   It is 1.23.0.rc1 in branch master.\n>\n>   Search for \"tag:\" in \"git log\" in my branch shows:\n>\n> commit c05b538c504106d55b81caa6400ea80797f03775 (tag: 1.23.0.rc1)\n> Author: Bertrand Garrigues <...>\n> Date:   Wed Nov 11 01:58:55 2020 +0100\n>\n>   \"git show-ref 1.23.0.rc1\" in my branch shows:\n>\n> faa3dff8d011e61721e763c71b6ccbf20a4675bc refs/tags/1.23.0.rc1\n>\n> ####\n>\n>   \"git-version-gen\" (gnulib) does not get the latest tag.\n>\n>   The call in configure.am is:\n>\n> AC_INIT([GNU Troff],[m4_esyscmd(build-aux/git-version-gen --prefix \"\"\n> .tarball-version)],[http://savannah.gnu.org/bugs/?group=g$\n>\n>   The files \".git/packed-refs\" and \".git/info/refs\" are the same in both\n> branches.\n>\n> #####\n>\n> [System Info]\n> git version 2.33.0 (Debian/testing Version: 1:2.33.0-1)\n> cpu: x86_64\n> no commit associated with this build\n> sizeof-long: 8\n> sizeof-size_t: 8\n> shell-path: /bin/sh\n> uname: Linux 5.14.9-2 #1 SMP Sun Oct 10 01:53:44 UTC 2021 x86_64\n> compiler info: gnuc: 10.2\n> libc info: glibc: 2.32\n> $SHELL (typically, interactive shell): /bin/bash\n\nDaginn.\n\nThe \"git describe\" command won't just return the latest tag name, but if\nyou're not on such an exact tag name find the \"closest\", and then add a\nsuffix indicating the distance and HEAD commit.\n\nReading between the lines I think you know that, but you're suprised\nthat it's finding 1.22.4 instead of 1.23.0.rc1, which newer.\n\nI tried to reproduce this and cloned\nhttps://git.savannah.gnu.org/git/groff.git; If you run e.g. this\ncommand:\n    \n    $ for c in $(git log --oneline 1.22.4..1.23.0.rc1 | awk '{print $1}'); do git describe $c; done\n    1.23.0.rc1\n    1.22.4-765-g10cd0b66\n    1.22.4-764-ge3b774ad\n    1.22.4-763-gfb52df3b\n    1.22.4-762-g0f42ca27\n    1.22.4-761-gdf73fc2b\n    1.22.4-760-g3afeb883\n    1.22.4-759-gcb1a9dc5\n    [...]\n\nYou'll see us describing all commits between 1.22.4..1.23.0-rc0, ending with:\n    \n    [...]\n    1.22.4-7-g72b4440e\n    1.22.4-6-g81908bc0\n    1.22.4-5-g9da68905\n    1.22.4-4-g2212cba0\n    1.22.4-3-ga3068bfd\n    1.22.4-2-g607236cc\n    1.22.4-1-gde9f9bfd\n\nBut as your tag \"1.22.4.3317-8f8c8-dirty\" shows we're at a distance of\n3317 from 1.22.4. Are you able to share whatever your 8f8c8 is\nsomewhere? I wonder if you're on some commit based off an older version.\n\nAside from what ref \"describe\" picked it's weird that a new version of\ngit would choose to show a 5-character hex abbreviation of the commit,\nthe minimum we show these days is 7, unless you have something setting\ne.g. this in config:\n\n    core.abbrev=5\n\nOr maybe that AC_INIT() macro does that somehow...\n"},{"id":"440183","messageId":"20211030231514.GA1086559@rhi.hi.is","threadId":"56798","inReplyTo":"211028.86wnlxwnqt.gmgdl@evledraar.gmail.com","subject":"Re: \"git describe --debug\" does not show the latest tag for \"groff\"","fromName":"Bjarni Ingi Gislason","fromEmail":"bjarniig@rhi.hi.is","sentAt":"2021-10-30T23:15:14Z","receivedAt":"2021-10-30T23:15:23Z","isPatch":false,"sender":{"key":"bjarniig@rhi.hi.is","avatar":null},"body":"On Thu, Oct 28, 2021 at 10:26:21AM +0200, Ævar Arnfjörð Bjarmason wrote:\n> \n> On Wed, Oct 27 2021, Bjarni Ingi Gislason wrote:\n> \n> > What did you do before the bug happened? (Steps to reproduce your issue)\n> >\n> >   I do not know, it could have happened anytime after the latest tag\n> > was committed (11th Nov. 2020).\n> >\n> > What did you expect to happen? (Expected behavior)\n> >\n> >   Seeing the latest tag \"1.23.0.rc1\" in the version string of \"groff\"\n> > (and in the output of \"git describe --debug\")\n> >\n> > What happened instead? (Actual behavior)\n> >\n> >   \"groff --version\" shows for example \"1.22.4.3317-8f8c8-dirty\"\n> >\n> >   \"git describe --debug\" shows:\n> >\n> > describe HEAD\n> > No exact match on refs or tags, searching to describe\n> > finished search at 2ac1f9ba5578cad27dc547d5be3c91753db436ea\n> >  annotated       3318 1.22.4\n> >  annotated       3319 1.22.4.rc5\n> >  annotated       3352 1.22.4.rc4\n> >  annotated       3464 1.22.4.rc3\n> >  annotated       3485 1.23.0.rc1\n> >  annotated       3572 1.22.4.rc2\n> >  annotated       3619 1.22.3.rc1\n> > traversed 3833 commits\n> > 1.22.4-3318-g3a1e750d\n> >\n> > What's different between what you expected and what actually happened?\n> >\n> >   The latest tag is not shown for the groff version.\n> >\n> > Anything else you want to add:\n> >\n> >\n> >   The latest tag in \"git log\" is 1.23.0.rc1 in my branch.\n> >   It is 1.23.0.rc1 in branch master.\n> >\n> >   Search for \"tag:\" in \"git log\" in my branch shows:\n> >\n> > commit c05b538c504106d55b81caa6400ea80797f03775 (tag: 1.23.0.rc1)\n> > Author: Bertrand Garrigues <...>\n> > Date:   Wed Nov 11 01:58:55 2020 +0100\n> >\n> >   \"git show-ref 1.23.0.rc1\" in my branch shows:\n> >\n> > faa3dff8d011e61721e763c71b6ccbf20a4675bc refs/tags/1.23.0.rc1\n> >\n> > ####\n> >\n> >   \"git-version-gen\" (gnulib) does not get the latest tag.\n> >\n> >   The call in configure.am is:\n> >\n> > AC_INIT([GNU Troff],[m4_esyscmd(build-aux/git-version-gen --prefix \"\"\n> > .tarball-version)],[http://savannah.gnu.org/bugs/?group=g$\n> >\n> >   The files \".git/packed-refs\" and \".git/info/refs\" are the same in both\n> > branches.\n> >\n> > #####\n> >\n> > [System Info]\n> > git version 2.33.0 (Debian/testing Version: 1:2.33.0-1)\n> > cpu: x86_64\n> > no commit associated with this build\n> > sizeof-long: 8\n> > sizeof-size_t: 8\n> > shell-path: /bin/sh\n> > uname: Linux 5.14.9-2 #1 SMP Sun Oct 10 01:53:44 UTC 2021 x86_64\n> > compiler info: gnuc: 10.2\n> > libc info: glibc: 2.32\n> > $SHELL (typically, interactive shell): /bin/bash\n> \n> Daginn.\n> \n> The \"git describe\" command won't just return the latest tag name, but if\n> you're not on such an exact tag name find the \"closest\", and then add a\n> suffix indicating the distance and HEAD commit.\n> \n> Reading between the lines I think you know that, but you're suprised\n> that it's finding 1.22.4 instead of 1.23.0.rc1, which newer.\n> \n> I tried to reproduce this and cloned\n> https://git.savannah.gnu.org/git/groff.git; If you run e.g. this\n> command:\n>     \n>     $ for c in $(git log --oneline 1.22.4..1.23.0.rc1 | awk '{print $1}'); do git describe $c; done\n>     1.23.0.rc1\n>     1.22.4-765-g10cd0b66\n>     1.22.4-764-ge3b774ad\n>     1.22.4-763-gfb52df3b\n>     1.22.4-762-g0f42ca27\n>     1.22.4-761-gdf73fc2b\n>     1.22.4-760-g3afeb883\n>     1.22.4-759-gcb1a9dc5\n>     [...]\n> \n> You'll see us describing all commits between 1.22.4..1.23.0-rc0, ending with:\n>     \n>     [...]\n>     1.22.4-7-g72b4440e\n>     1.22.4-6-g81908bc0\n>     1.22.4-5-g9da68905\n>     1.22.4-4-g2212cba0\n>     1.22.4-3-ga3068bfd\n>     1.22.4-2-g607236cc\n>     1.22.4-1-gde9f9bfd\n> \n> But as your tag \"1.22.4.3317-8f8c8-dirty\" shows we're at a distance of\n> 3317 from 1.22.4. Are you able to share whatever your 8f8c8 is\n> somewhere? I wonder if you're on some commit based off an older version.\n> \n> Aside from what ref \"describe\" picked it's weird that a new version of\n> git would choose to show a 5-character hex abbreviation of the commit,\n> the minimum we show these days is 7, unless you have something setting\n> e.g. this in config:\n> \n>     core.abbrev=5\n> \n> Or maybe that AC_INIT() macro does that somehow...\n\n  The latest tagged version (1.23.0.rc1) is actually in the output of\n\"git describe --debug\", but at the wrong place.\n\n  \"git log\" on the console shows the tag \"1.23.0.rc1\" to be the first\none.\n\n  \"git log\" directed to a file does not show any 'tag' in the commit\nlines!\n\n  \"git describe\" gets the sorting wrong.\n\n  Part of output from \"git log | grep '^commit [0-9a-f]' | cat -n\":\n\n     1\tcommit 3a1e750d2e03ed67eff01155ace01a0657c23ad7\n     2\tcommit 8f8c8ab812093554ebdf3a3218c8944302c9eb94 <--\n     3\tcommit 86b12aaaf5b7ceac78df11c53d3f45e1de0d8522\n...\n  1939\tcommit 2e52c43497d6078d1be3edf12aec962a91cb54e2\n  1940\tcommit 2ca9c70def2b83cb5ad4cb5da0c0e2533a21b133\n  1941\tcommit ab3e18c27ea1890bb98812a80d1e36c1c03f5db3\n  1942\tcommit c05b538c504106d55b81caa6400ea80797f03775 <-- 1.23.0.rc1\n  1943\tcommit 10cd0b662256d6fd2b6ed204f0ce891c8fc1175d\n  1944\tcommit a4584886ce3391d85b6d1e2c774bf919cdd94451\n...\n  3004  commit a3068bfda2e25584e4d07781162179cb79829f56\n  3005  commit 607236cc2ba834f326d01db189026f3dc28e118b\n  3006  commit de9f9bfdf63245967bdbe56c503d587fcf0b279b\n  3007  commit cc292790528abb8985c8b743ac3887f7f393cd7a <-- 1.22.4\n  3008  commit 39cade0f09d9531d15abe7873101694cf0140ba4\n  3009  commit 743c23c7f9d2a4e8f6e7cd555703487521dd012d\n  3010  commit b78b8ba1a973421ad00770fc10bcd894fc7fc717\n...\n  6712\tcommit a48ab7b6db26b1d98f77f59f22896fe02a700c40\n  6713\tcommit bd5385e4ea12522ba7e852fa3a628f3be854f674\n  6714\tcommit 351da0dcdf702cf243d26ffa998961bce2aa8653\n\nIn \".git/info/refs\" commit 1.23.0.rc1 is listed with an affix \"^{}\".\n\n  Without an affix the commit is \"faa3dff8...\", which is not in the\noutput of \"git log\".\n\n  The used expression of \"git describe\" uses \"--abbrev=4\" (in\ngit-version-gen) for generating version strings for \"groff\".\n\n-- \nBjarni I. Gislason\n"},{"id":"440185","messageId":"CAPx1GvfJcmUQm515U9fWW9fKKZihoO+PiM08G_xiARtiG_Eb6w@mail.gmail.com","threadId":"56798","inReplyTo":"20211030231514.GA1086559@rhi.hi.is","subject":"Re: \"git describe --debug\" does not show the latest tag for \"groff\"","fromName":"Chris Torek","fromEmail":"chris.torek@gmail.com","sentAt":"2021-10-31T00:12:06Z","receivedAt":"2021-10-31T00:12:28Z","isPatch":false,"sender":{"key":"chris.torek@gmail.com","avatar":"https://avatars.githubusercontent.com/u/16826774?v=4"},"body":"On Sat, Oct 30, 2021 at 4:24 PM Bjarni Ingi Gislason <bjarniig@rhi.hi.is> wrote:\n>   \"git log\" on the console shows the tag \"1.23.0.rc1\" to be the first\n> one.\n\nBy this, do you mean that `git log` shows the tag on the HEAD commit?\nOr do you mean that this is the first tag that `git log` emits?  Note\nthat `git log` walks complex graphs in a funny order by default; you'd\nneed `--topo-order` (and usually `--graph` too) to see what's really\ngoing on.\n\n>   \"git log\" directed to a file does not show any 'tag' in the commit\n> lines!\n\nThat's normal if you have `--decorate`  set to `auto` (many do: it used\nto be sensible ages ago, and I still have that set in my own default git\nconfig).  Tags, in `git log` output,are decorations, and\n`auto` means *if going to terminal*.\n\nChris\n"}]}