git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[BUG] git describe number of commits different from git log count

From
JHJan Hudec <bulb@ucw.cz>
Date
Feb 5, 2016, 11:17 UTC
Message-ID
<1701823.75Syo8h0k0@box>
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>
Next: Aaron Schrab
Message 1 of 2 in “[BUG] git describe number of commits different from git log count”
  1. Jan HudecFeb 5, 2016
  2. Aaron SchrabDec 5, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.