{"thread":{"id":"56680","subject":"git log with %(describe) placeholder does not find most recent tag","startedAt":"2021-10-11T08:08:43Z","lastAt":"2021-10-11T16:23:39Z","messageCount":5,"participants":["Benjamin Kircher","Bagas Sanjaya","Carlo Arenas","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"438445","messageId":"61d28b8e9dd906eba821ecc9ee81bd4ac2374494.camel@0xadd.de","threadId":"56680","inReplyTo":null,"subject":"git log with %(describe) placeholder does not find most recent tag","fromName":"Benjamin Kircher","fromEmail":"bkircher@0xadd.de","sentAt":"2021-10-11T08:08:37Z","receivedAt":"2021-10-11T08:08:43Z","isPatch":false,"sender":{"key":"bkircher@0xadd.de","avatar":null},"body":"Hello there,\n\n\nWhat did you do before the bug happened? (Steps to reproduce your\nissue)\n\n    git log --format='%(describe)' -n1\n\nproduces a different result than\n\n    git describe --tags\n\nWhat did you expect to happen? (Expected behavior)\n\nI expected both to produce (roughly) the same result. At least,\nreference the same tag.\n\nWhat happened instead? (Actual behavior)\n\n    git log --format='%(describe)' -n1\n    v0.11.0\n\nand\n\n    git log --format='%(describe)' -n1\n    v0.3.0-beta-253-g4ccd023\n\nWhat's different between what you expected and what actually happened?\n\ngit log with %(describe) placeholder does not seem to find the most\nrecent tag as git-describe would do. Is this intended?\n\n\n[System Info]\ngit version:\ngit version 2.33.0\ncpu: x86_64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: Linux 5.14.10-200.fc34.x86_64 #1 SMP Thu Oct 7 20:49:53 UTC 2021\nx86_64\ncompiler info: gnuc: 11.2\nlibc info: glibc: 2.33\n$SHELL (typically, interactive shell): /bin/zsh\n\n\n[Enabled Hooks]\n\n\n"},{"id":"438446","messageId":"732e64ad-0ca0-d384-a09b-55c74479e254@gmail.com","threadId":"56680","inReplyTo":"61d28b8e9dd906eba821ecc9ee81bd4ac2374494.camel@0xadd.de","subject":"Re: git log with %(describe) placeholder does not find most recent tag","fromName":"Bagas Sanjaya","fromEmail":"bagasdotme@gmail.com","sentAt":"2021-10-11T08:23:19Z","receivedAt":"2021-10-11T08:23:25Z","isPatch":false,"sender":{"key":"bagasdotme@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40219486?v=4"},"body":"On 11/10/21 15.08, Benjamin Kircher wrote:\n> What did you do before the bug happened? (Steps to reproduce your\n> issue)\n> \n>      git log --format='%(describe)' -n1\n> \n> produces a different result than\n> \n>      git describe --tags\n> \n> What did you expect to happen? (Expected behavior)\n> \n> I expected both to produce (roughly) the same result. At least,\n> reference the same tag.\n> \n> What happened instead? (Actual behavior)\n> \n>      git log --format='%(describe)' -n1\n>      v0.11.0\n> \n> and\n> \n>      git log --format='%(describe)' -n1\n>      v0.3.0-beta-253-g4ccd023\n> \n> What's different between what you expected and what actually happened?\n> \n> git log with %(describe) placeholder does not seem to find the most\n> recent tag as git-describe would do. Is this intended?\n\nI tried to reproduce your issue. I have linux.git shallow repo (master \nbranch pulls from torvalds' mainline tree and stable branches pull from \nstable tree). HEAD currently points to v5.15-rc5 tag.\n\nThe result (note that I use custom-compiled Git):\n\n```\n$ /opt/git/bin/git version\ngit version 2.33.0\n\n$ /opt/git/bin/git log -n 1 --format='%(describe)'\nv5.15-rc5\n\n$ /opt/git/bin/git describe --tags\nv5.15-rc5\n```\n\nBoth results (git log and git describe) are same.\n\n-- \nAn old man doll... just what I always wanted! - Clara\n"},{"id":"438447","messageId":"39ac5fe17bdf0f486cb8ffd4b8dec6d60acc9244.camel@0xadd.de","threadId":"56680","inReplyTo":"732e64ad-0ca0-d384-a09b-55c74479e254@gmail.com","subject":"Re: git log with %(describe) placeholder does not find most recent tag","fromName":"Benjamin Kircher","fromEmail":"bkircher@0xadd.de","sentAt":"2021-10-11T08:29:56Z","receivedAt":"2021-10-11T08:30:02Z","isPatch":false,"sender":{"key":"bkircher@0xadd.de","avatar":null},"body":"On Mon, 2021-10-11 at 15:23 +0700, Bagas Sanjaya wrote:\n> Both results (git log and git describe) are same.\n\nYes. Good one. Absolutely correct. I wasn't able to reproduce that with\nLinux repository, too.\n\nProblem is observed only in some repositories while others seem fine.\n\nI was able to reproduce it with a freshly cloned version of:\n\n  https://github.com/gridscale/gscloud.git\n\nBK\n\n\n"},{"id":"438459","messageId":"CAPUEsphLXcCw=Qj1Rw5ONf2GduQAs62VwkVd3gTt4=PLaGkBcg@mail.gmail.com","threadId":"56680","inReplyTo":"61d28b8e9dd906eba821ecc9ee81bd4ac2374494.camel@0xadd.de","subject":"Re: git log with %(describe) placeholder does not find most recent tag","fromName":"Carlo Arenas","fromEmail":"carenas@gmail.com","sentAt":"2021-10-11T12:27:39Z","receivedAt":"2021-10-11T12:27:53Z","isPatch":false,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"On Mon, Oct 11, 2021 at 1:10 AM Benjamin Kircher <bkircher@0xadd.de> wrote:\n> produces a different result than\n>\n>     git describe --tags\n\nif the repository you are looking at has non annotated tags (the ones\nthat have no signature or message and that are created by default with\n`git tag`), then that is expected and explained in the documentation\nfor the '--tags' option you are using.\n\nCarlo\n"},{"id":"438477","messageId":"YWRlBLu+st02X7MD@coredump.intra.peff.net","threadId":"56680","inReplyTo":"CAPUEsphLXcCw=Qj1Rw5ONf2GduQAs62VwkVd3gTt4=PLaGkBcg@mail.gmail.com","subject":"Re: git log with %(describe) placeholder does not find most recent tag","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2021-10-11T16:23:32Z","receivedAt":"2021-10-11T16:23:39Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Oct 11, 2021 at 05:27:39AM -0700, Carlo Arenas wrote:\n\n> On Mon, Oct 11, 2021 at 1:10 AM Benjamin Kircher <bkircher@0xadd.de> wrote:\n> > produces a different result than\n> >\n> >     git describe --tags\n> \n> if the repository you are looking at has non annotated tags (the ones\n> that have no signature or message and that are created by default with\n> `git tag`), then that is expected and explained in the documentation\n> for the '--tags' option you are using.\n\nYes, that's the case in the example repo he showed. I don't think there\nis currently a way to convince %(describe) to use \"--tags\" in the\nunderlying describe command, but it seems like a reasonable extension if\nsomebody is interested in writing it. We already take some options to\n%(describe), so the syntax is prepared to add more.\n\n-Peff\n"}]}