git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [BUG] git describe number of commits different from git log count
@ 2016-02-05 11:17 Jan Hudec
  2016-12-05 23:27 ` Aaron Schrab
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Hudec @ 2016-02-05 11:17 UTC (permalink / raw)
  To: git

Hello,

I have a repository with following situation:

    $ git describe next
    v4.1-2196-g5a414d7
    $ git describe next --match=v4.2
    v4.2-4757-g5a414d7

Since the tag with fewest commits since is selected, it appears logical. 
However, v4.2 is descendant of v4.1, so it does not make sense for it to have 
more commits since. And rev-list or log confirm that:

    $ git rev-list v4.1..next | wc -l
    2196
    $ git rev-list v4.2..next | wc -l
    1152

The number of commits since v4.1 matches what the describe counted, but the 
number of commits since v4.2 does not.

The v4.1 tag should be reachable along the first parent path, the v4.2 
definitely isn't, but I am not asking for first parent path.

I am using

    $ git --version
    git version 2.7.0

from Debian git 1:2.7.0-1 package locally, but our build server is still using 
rather ancient

    $ git --version
    git version 1.8.4.msysgit.0

with exactly the same result.

Unfortunately I can't share the repository, but I could run some tests on it, 
including rebuilding git with some diagnostics and trying that.

Note that the tag v4.2 is otherwise perfectly good candidate for describe and 
gets used just fine when describing master:

    $ git describe master
    v4.2-2-g34eb80b
    $ git describe master --match=v4.1
    v4.1-1046-g34eb80b

However when I merged master into next, it started producing those incorrect 
results.

-- 
 - Jan Hudec <bulb@ucw.cz>

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

* Re: git describe number of commits different from git log count
  2016-02-05 11:17 [BUG] git describe number of commits different from git log count Jan Hudec
@ 2016-12-05 23:27 ` Aaron Schrab
  0 siblings, 0 replies; 2+ messages in thread
From: Aaron Schrab @ 2016-12-05 23:27 UTC (permalink / raw)
  To: Jan Hudec; +Cc: git

At 12:17 +0100 05 Feb 2016, Jan Hudec <bulb@ucw.cz> wrote:
>I have a repository with following situation:
>
>    $ git describe next
>    v4.1-2196-g5a414d7
>    $ git describe next --match=v4.2
>    v4.2-4757-g5a414d7
>
>Since the tag with fewest commits since is selected, it appears logical.
>However, v4.2 is descendant of v4.1, so it does not make sense for it to have
>more commits since. And rev-list or log confirm that:
>
>    $ git rev-list v4.1..next | wc -l
>    2196
>    $ git rev-list v4.2..next | wc -l
>    1152
>
>The number of commits since v4.1 matches what the describe counted, but the
>number of commits since v4.2 does not.

I'm encountering what seems to be a similar issue. I'm working with the 
`build` branch of https://github.com/aschrab/mutt currently at 65b7094.  
Most of the commits in that repo come from a mercurial repository, but I 
don't think that is really effecting things (other than being related to 
the need to use the --tags option).

  $ git describe --tags
  mutt-1-7-1-rel-137-g65b7094

  $ git describe --tags --match=mutt-1-7-2-rel
  mutt-1-7-2-rel-6246-g65b7094

  $ git rev-list --count mutt-1-7-2-rel..HEAD
  126

  $ git rev-list --count mutt-1-7-1-rel..HEAD
  137

  $ git --version
  git version 2.10.2

The number of additional commits shown when I force the tag is 
completely insane! That's nearly every commit that is part of that 
branch:

  1036$ git rev-list --count HEAD
  6250

Both of the tags above should be reachable along the first-parent path.  
If I add the `--first-parent` option to the describe command it picks 
the expected tag and the number additional commits seems sane:

  $ git describe --tags --first-parent
  mutt-1-7-2-rel-14-g65b7094

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

end of thread, other threads:[~2016-12-05 23:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-05 11:17 [BUG] git describe number of commits different from git log count Jan Hudec
2016-12-05 23:27 ` Aaron Schrab

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).