{"thread":{"id":"41339","subject":"[BUG] git describe number of commits different from git log count","startedAt":"2016-02-05T11:17:25Z","lastAt":"2016-12-05T23:37:04Z","messageCount":2,"participants":["Jan Hudec","Aaron Schrab"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"277535","messageId":"1701823.75Syo8h0k0@box","threadId":"41339","inReplyTo":null,"subject":"[BUG] git describe number of commits different from git log count","fromName":"Jan Hudec","fromEmail":"bulb@ucw.cz","sentAt":"2016-02-05T11:17:25Z","receivedAt":"2016-02-05T11:17:25Z","isPatch":false,"sender":{"key":"bulb@ucw.cz","avatar":null},"body":"Hello,\n\nI have a repository with following situation:\n\n    $ git describe next\n    v4.1-2196-g5a414d7\n    $ git describe next --match=v4.2\n    v4.2-4757-g5a414d7\n\nSince the tag with fewest commits since is selected, it appears logical. \nHowever, v4.2 is descendant of v4.1, so it does not make sense for it to have \nmore commits since. And rev-list or log confirm that:\n\n    $ git rev-list v4.1..next | wc -l\n    2196\n    $ git rev-list v4.2..next | wc -l\n    1152\n\nThe number of commits since v4.1 matches what the describe counted, but the \nnumber of commits since v4.2 does not.\n\nThe v4.1 tag should be reachable along the first parent path, the v4.2 \ndefinitely isn't, but I am not asking for first parent path.\n\nI am using\n\n    $ git --version\n    git version 2.7.0\n\nfrom Debian git 1:2.7.0-1 package locally, but our build server is still using \nrather ancient\n\n    $ git --version\n    git version 1.8.4.msysgit.0\n\nwith exactly the same result.\n\nUnfortunately I can't share the repository, but I could run some tests on it, \nincluding rebuilding git with some diagnostics and trying that.\n\nNote that the tag v4.2 is otherwise perfectly good candidate for describe and \ngets used just fine when describing master:\n\n    $ git describe master\n    v4.2-2-g34eb80b\n    $ git describe master --match=v4.1\n    v4.1-1046-g34eb80b\n\nHowever when I merged master into next, it started producing those incorrect \nresults.\n\n-- \n - Jan Hudec <bulb@ucw.cz>\n"},{"id":"306982","messageId":"20161205232712.GA23868@pug.qqx.org","threadId":"41339","inReplyTo":"1701823.75Syo8h0k0@box","subject":"Re: git describe number of commits different from git log count","fromName":"Aaron Schrab","fromEmail":"aaron@schrab.com","sentAt":"2016-12-05T23:27:12Z","receivedAt":"2016-12-05T23:37:04Z","isPatch":false,"sender":{"key":"aaron@schrab.com","avatar":"https://avatars.githubusercontent.com/u/39620?v=4"},"body":"At 12:17 +0100 05 Feb 2016, Jan Hudec <bulb@ucw.cz> wrote:\n>I have a repository with following situation:\n>\n>    $ git describe next\n>    v4.1-2196-g5a414d7\n>    $ git describe next --match=v4.2\n>    v4.2-4757-g5a414d7\n>\n>Since the tag with fewest commits since is selected, it appears logical.\n>However, v4.2 is descendant of v4.1, so it does not make sense for it to have\n>more commits since. And rev-list or log confirm that:\n>\n>    $ git rev-list v4.1..next | wc -l\n>    2196\n>    $ git rev-list v4.2..next | wc -l\n>    1152\n>\n>The number of commits since v4.1 matches what the describe counted, but the\n>number of commits since v4.2 does not.\n\nI'm encountering what seems to be a similar issue. I'm working with the \n`build` branch of https://github.com/aschrab/mutt currently at 65b7094.  \nMost of the commits in that repo come from a mercurial repository, but I \ndon't think that is really effecting things (other than being related to \nthe need to use the --tags option).\n\n  $ git describe --tags\n  mutt-1-7-1-rel-137-g65b7094\n\n  $ git describe --tags --match=mutt-1-7-2-rel\n  mutt-1-7-2-rel-6246-g65b7094\n\n  $ git rev-list --count mutt-1-7-2-rel..HEAD\n  126\n\n  $ git rev-list --count mutt-1-7-1-rel..HEAD\n  137\n\n  $ git --version\n  git version 2.10.2\n\nThe number of additional commits shown when I force the tag is \ncompletely insane! That's nearly every commit that is part of that \nbranch:\n\n  1036$ git rev-list --count HEAD\n  6250\n\nBoth of the tags above should be reachable along the first-parent path.  \nIf I add the `--first-parent` option to the describe command it picks \nthe expected tag and the number additional commits seems sane:\n\n  $ git describe --tags --first-parent\n  mutt-1-7-2-rel-14-g65b7094\n"}]}