git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git log with %(describe) placeholder does not find most recent tag
@ 2021-10-11  8:08 Benjamin Kircher
  2021-10-11  8:23 ` Bagas Sanjaya
  2021-10-11 12:27 ` Carlo Arenas
  0 siblings, 2 replies; 5+ messages in thread
From: Benjamin Kircher @ 2021-10-11  8:08 UTC (permalink / raw)
  To: git

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]



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git log with %(describe) placeholder does not find most recent tag
  2021-10-11  8:08 git log with %(describe) placeholder does not find most recent tag Benjamin Kircher
@ 2021-10-11  8:23 ` Bagas Sanjaya
  2021-10-11  8:29   ` Benjamin Kircher
  2021-10-11 12:27 ` Carlo Arenas
  1 sibling, 1 reply; 5+ messages in thread
From: Bagas Sanjaya @ 2021-10-11  8:23 UTC (permalink / raw)
  To: Benjamin Kircher, git

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git log with %(describe) placeholder does not find most recent tag
  2021-10-11  8:23 ` Bagas Sanjaya
@ 2021-10-11  8:29   ` Benjamin Kircher
  0 siblings, 0 replies; 5+ messages in thread
From: Benjamin Kircher @ 2021-10-11  8:29 UTC (permalink / raw)
  To: Bagas Sanjaya, git

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git log with %(describe) placeholder does not find most recent tag
  2021-10-11  8:08 git log with %(describe) placeholder does not find most recent tag Benjamin Kircher
  2021-10-11  8:23 ` Bagas Sanjaya
@ 2021-10-11 12:27 ` Carlo Arenas
  2021-10-11 16:23   ` Jeff King
  1 sibling, 1 reply; 5+ messages in thread
From: Carlo Arenas @ 2021-10-11 12:27 UTC (permalink / raw)
  To: Benjamin Kircher; +Cc: git

On Mon, Oct 11, 2021 at 1:10 AM Benjamin Kircher <bkircher@0xadd.de> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git log with %(describe) placeholder does not find most recent tag
  2021-10-11 12:27 ` Carlo Arenas
@ 2021-10-11 16:23   ` Jeff King
  0 siblings, 0 replies; 5+ messages in thread
From: Jeff King @ 2021-10-11 16:23 UTC (permalink / raw)
  To: Carlo Arenas; +Cc: Benjamin Kircher, git

On Mon, Oct 11, 2021 at 05:27:39AM -0700, Carlo Arenas wrote:

> On Mon, Oct 11, 2021 at 1:10 AM Benjamin Kircher <bkircher@0xadd.de> 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.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-11 16:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-11  8:08 git log with %(describe) placeholder does not find most recent tag Benjamin Kircher
2021-10-11  8:23 ` Bagas Sanjaya
2021-10-11  8:29   ` Benjamin Kircher
2021-10-11 12:27 ` Carlo Arenas
2021-10-11 16:23   ` Jeff King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).