{"thread":{"id":"49416","subject":"bug in 'git describe'?","startedAt":"2018-09-24T22:05:17Z","lastAt":"2018-09-25T16:11:28Z","messageCount":5,"participants":["Sebastian Kuzminsky","Junio C Hamano","Duy Nguyen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"358798","messageId":"fd340f7b-61c0-2661-bdca-c239e51bc464@highlab.com","threadId":"49416","inReplyTo":null,"subject":"bug in 'git describe'?","fromName":"Sebastian Kuzminsky","fromEmail":"seb@highlab.com","sentAt":"2018-09-24T21:45:06Z","receivedAt":"2018-09-24T22:05:17Z","isPatch":false,"sender":{"key":"seb@highlab.com","avatar":"https://gravatar.com/avatar/f7ddd092ba3cf6999434f4d0d2f4b90fd174c2c3851617e8cffc0a2fee47becc?d=mp&s=160"},"body":"I think I've run in to a bug in 'git describe' (reproduced with git \n2.11.0, 2.16.1, and 2.19.0.221.g150f307af).\n\nI've got two tiny git repos whose commit graphs are identical, but where \n'git describe' gives different results.\n\n>     *   merge 1.1 into 2.0  (HEAD -> release-2.0)\n>     |\\\n>     | *   merge boo into 1.1  (tag: release/1.1.1, release-1.1)\n>     | |\\\n>     | | * dummy commit  (boo)\n>     | * | dummy commit  (tag: release/1.1.0)\n>     * | |   merge feature into 2.0\n>     |\\ \\ \\\n>     | * | | dummy commit  (feature)\n>     |/ / /\n>     * | | dummy commit  (tag: release/2.0.1)\n>     * | | dummy commit  (tag: release/2.0.0)\n>     |/ /\n>     * | dummy commit  (release-1.0)\n>     |/\n>     * dummy commit  (tag: release/1.0.0)\n\nThe tag 'release/1.0.0' is the first commit in history.\n\nThe histories differ only in the timestamps of the commits (and thus the \nSHAs of the commit objects).\n\nGood repo: release/2.0.1-6-gbc33a04\nBad repo: release/2.0.1-8-g2c0a20c\n\nDetails, including full copies of both repos, here:\n\nhttp://highlab.com/~seb/git-describe-bug/\n\n\n-- \nSebastian Kuzminsky\n"},{"id":"358800","messageId":"xmqqefdir0tz.fsf@gitster-ct.c.googlers.com","threadId":"49416","inReplyTo":"fd340f7b-61c0-2661-bdca-c239e51bc464@highlab.com","subject":"Re: bug in 'git describe'?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-09-24T22:24:08Z","receivedAt":"2018-09-24T22:24:13Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sebastian Kuzminsky <seb@highlab.com> writes:\n\n> I've got two tiny git repos whose commit graphs are identical, but\n> where 'git describe' gives different results.\n> ...\n> The histories differ only in the timestamps of the commits...\n\ndescribe does take the commit timestamps into account, so it is\nexpected you would get different results out of an otherwise\nidentically looking graph.\n"},{"id":"358838","messageId":"dbd2dcef-c892-3628-119e-f688e74f3599@highlab.com","threadId":"49416","inReplyTo":"xmqqefdir0tz.fsf@gitster-ct.c.googlers.com","subject":"Re: bug in 'git describe'?","fromName":"Sebastian Kuzminsky","fromEmail":"seb@highlab.com","sentAt":"2018-09-25T15:39:43Z","receivedAt":"2018-09-25T15:39:53Z","isPatch":false,"sender":{"key":"seb@highlab.com","avatar":"https://gravatar.com/avatar/f7ddd092ba3cf6999434f4d0d2f4b90fd174c2c3851617e8cffc0a2fee47becc?d=mp&s=160"},"body":"On 9/24/18 4:24 PM, Junio C Hamano wrote:\n> Sebastian Kuzminsky <seb@highlab.com> writes:\n> \n>> I've got two tiny git repos whose commit graphs are identical, but \n>> where 'git describe' gives different results. ... The histories\n>> differ only in the timestamps of the commits...\n> \n> describe does take the commit timestamps into account, so it is \n> expected you would get different results out of an otherwise \n> identically looking graph.\n\nThanks for that confirmation.\n\nThat behavior seems to me to be different from what the (2.11) manpage says:\n\n> it suffixes the tag name with the number of additional commits on top\n> of the tagged object\n\n\nAnd:\n\n> If multiple tags were found during the walk then the tag which has\n> the fewest commits different from the input commit-ish will be\n> selected and output. Here fewest commits different is defined as the\n> number of commits which would be shown by git log tag..input will be\n> the smallest number of commits possible.\n\nAll that said, if you consider this \"working as expected\" then i'm \ncontent to let the matter drop.\n\n\n-- \nSebastian Kuzminsky\n"},{"id":"358841","messageId":"CACsJy8C4+cj=K2NetC05rmwenY0cArQ7NehZZ+Df90fmzBVThA@mail.gmail.com","threadId":"49416","inReplyTo":"dbd2dcef-c892-3628-119e-f688e74f3599@highlab.com","subject":"Re: bug in 'git describe'?","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2018-09-25T16:05:49Z","receivedAt":"2018-09-25T16:06:17Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Tue, Sep 25, 2018 at 5:41 PM Sebastian Kuzminsky <seb@highlab.com> wrote:\n> That behavior seems to me to be different from what the (2.11) manpage says:\n\nGood opportunity to improve the man page anyway even if Junio is\nright. I agree that the section about \"search strategy\" is a bit\nmisleading because it does not mention anything about time stuff.\n\n>\n> > it suffixes the tag name with the number of additional commits on top\n> > of the tagged object\n>\n>\n> And:\n>\n> > If multiple tags were found during the walk then the tag which has\n> > the fewest commits different from the input commit-ish will be\n> > selected and output. Here fewest commits different is defined as the\n> > number of commits which would be shown by git log tag..input will be\n> > the smallest number of commits possible.\n-- \nDuy\n"},{"id":"358842","messageId":"CACsJy8C+WWkwFjoFT+Y-Ga2ZxSbOn-OkKCyKYFU4qJfXyuJY-w@mail.gmail.com","threadId":"49416","inReplyTo":"CACsJy8C4+cj=K2NetC05rmwenY0cArQ7NehZZ+Df90fmzBVThA@mail.gmail.com","subject":"Re: bug in 'git describe'?","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2018-09-25T16:10:59Z","receivedAt":"2018-09-25T16:11:28Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Tue, Sep 25, 2018 at 6:05 PM Duy Nguyen <pclouds@gmail.com> wrote:\n>\n> On Tue, Sep 25, 2018 at 5:41 PM Sebastian Kuzminsky <seb@highlab.com> wrote:\n> > That behavior seems to me to be different from what the (2.11) manpage says:\n>\n> Good opportunity to improve the man page anyway even if Junio is\n> right. I agree that the section about \"search strategy\" is a bit\n> misleading because it does not mention anything about time stuff.\n\nIf anybody's updating the man page, I think this is the commit that\nchanged git-describe's search strategy: 80dbae03b0 (Chose better tag\nnames in git-describe after merges. - 2007-01-10)\n\n--\nDuy\n"}]}