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

Re: git log with %(describe) placeholder does not find most recent tag

From
Bagas Sanjaya <bagasdotme@gmail.com>
Date
Oct 11, 2021, 08:23 UTC
Message-ID
<732e64ad-0ca0-d384-a09b-55c74479e254@gmail.com>
In-Reply-To
<61d28b8e9dd906eba821ecc9ee81bd4ac2374494.camel@0xadd.de>
On 11/10/21 15.08, Benjamin Kircher wrote:
Show 28 quoted lines
> What did you do before the bug happened? (Steps to reproduce your
> issue)
> 
>      git log --format='%(describe)' -n1
> 
> produces a different result than
> 
>      git describe --tags
> 
> What did you expect to happen? (Expected behavior)
> 
> I expected both to produce (roughly) the same result. At least,
> reference the same tag.
> 
> What happened instead? (Actual behavior)
> 
>      git log --format='%(describe)' -n1
>      v0.11.0
> 
> and
> 
>      git log --format='%(describe)' -n1
>      v0.3.0-beta-253-g4ccd023
> 
> What's different between what you expected and what actually happened?
> 
> git log with %(describe) placeholder does not seem to find the most
> recent tag as git-describe would do. Is this intended?

I tried to reproduce your issue. I have linux.git shallow repo (master branch pulls from torvalds' mainline tree and stable branches pull from stable tree). HEAD currently points to v5.15-rc5 tag.

The result (note that I use custom-compiled Git):

``` $ /opt/git/bin/git version git version 2.33.0

$ /opt/git/bin/git log -n 1 --format='%(describe)' v5.15-rc5

$ /opt/git/bin/git describe --tags v5.15-rc5 ```

Both results (git log and git describe) are same.
-- 
An old man doll... just what I always wanted! - Clara
Previous: Benjamin KircherNext: Benjamin Kircher
Message 2 of 5 in “git log with %(describe) placeholder does not find most recent tag”
  1. Benjamin KircherOct 11, 2021
  2. Bagas SanjayaOct 11, 2021
  3. Benjamin KircherOct 11, 2021
  4. Carlo ArenasOct 11, 2021
  5. Jeff KingOct 11, 2021

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.