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

5 messages, 4 authors, 2021-10-11 · open the first message on its own page

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

From: Benjamin Kircher <hidden>
Date: 2021-10-11 08:08:43

Hello there,


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?


[System Info]
git version:
git version 2.33.0
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 5.14.10-200.fc34.x86_64 #1 SMP Thu Oct 7 20:49:53 UTC 2021
x86_64
compiler info: gnuc: 11.2
libc info: glibc: 2.33
$SHELL (typically, interactive shell): /bin/zsh


[Enabled Hooks]

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

From: Bagas Sanjaya <hidden>
Date: 2021-10-11 08:23:25

On 11/10/21 15.08, Benjamin Kircher wrote:
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

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

From: Benjamin Kircher <hidden>
Date: 2021-10-11 08:30:02

On Mon, 2021-10-11 at 15:23 +0700, Bagas Sanjaya wrote:
Both results (git log and git describe) are same.
Yes. Good one. Absolutely correct. I wasn't able to reproduce that with
Linux repository, too.

Problem is observed only in some repositories while others seem fine.

I was able to reproduce it with a freshly cloned version of:

  https://github.com/gridscale/gscloud.git

BK

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

From: Carlo Arenas <hidden>
Date: 2021-10-11 12:27:53

On Mon, Oct 11, 2021 at 1:10 AM Benjamin Kircher [off-list ref] wrote:
produces a different result than

    git describe --tags
if the repository you are looking at has non annotated tags (the ones
that have no signature or message and that are created by default with
`git tag`), then that is expected and explained in the documentation
for the '--tags' option you are using.

Carlo

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

From: Jeff King <hidden>
Date: 2021-10-11 16:23:39

On Mon, Oct 11, 2021 at 05:27:39AM -0700, Carlo Arenas wrote:
On Mon, Oct 11, 2021 at 1:10 AM Benjamin Kircher [off-list ref] wrote:
quoted
produces a different result than

    git describe --tags
if the repository you are looking at has non annotated tags (the ones
that have no signature or message and that are created by default with
`git tag`), then that is expected and explained in the documentation
for the '--tags' option you are using.
Yes, that's the case in the example repo he showed. I don't think there
is currently a way to convince %(describe) to use "--tags" in the
underlying describe command, but it seems like a reasonable extension if
somebody is interested in writing it. We already take some options to
%(describe), so the syntax is prepared to add more.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help