git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Bug in 'git describe' if I have two tags on the same commit.

From
Kevin Daudt <me@ikke.info>
Date
Feb 13, 2017, 15:44 UTC
Message-ID
<20170213154407.GA31568@alpha.ikke.info>
In-Reply-To
<CAOcUJQwnCJOhUUU2RqJP2H5YxUr4qCEpyDj_XiiQSe4V6rcBmg@mail.gmail.com>
On Sun, Feb 12, 2017 at 01:15:22PM +0100, Istvan Pato wrote:
Show 36 quoted lines
> I didn't get back the latest tag by 'git describe --tags --always' if
> I have two tags on the same commit.
> 
> // repository ppa:git-core/ppa
> 
> (master)⚡ % cat /etc/lsb-release
> DISTRIB_ID=Ubuntu
> DISTRIB_RELEASE=16.04
> DISTRIB_CODENAME=xenial
> DISTRIB_DESCRIPTION="Ubuntu 16.04.2 LTS"
> 
> (master)⚡ % git --version
> git version 2.11.0
> 
> (master) [1] % git show-ref --tag
> 76c634390... refs/tags/1.0.0
> b77c7cd17... refs/tags/1.1.0
> b77c7cd17... refs/tags/1.2.0
> 
> (master) % git describe --tags --always
> 1.1.0-1-ge9e9ced
> 
> ### Expected: 1.2.0
> 
> References:
> 
> https://www.kernel.org/pub/software/scm/git/docs/RelNotes-1.7.1.1.txt
> 
> * "git describe" did not tie-break tags that point at the same commit
>   correctly; newer ones are preferred by paying attention to the
>   tagger date now.
> 
> http://stackoverflow.com/questions/8089002/git-describe-with-two-tags-on-the-same-commit
> 
> Thanks,
> Istvan Pato

Are these lightweight tags? Only annotated tags have a date associated to them, which is where the rel-notes refers to.

Previous: Istvan PatoNext: Junio C Hamano
Message 2 of 4 in “Bug in 'git describe' if I have two tags on the same commit.”
  1. Istvan PatoFeb 12, 2017
  2. Kevin DaudtFeb 13, 2017
  3. Junio C HamanoFeb 13, 2017
  4. Istvan PatoFeb 14, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.