Consider this excerpt of git log --oneline --decorate --graph
:
* 552485a (HEAD -> master, origin/master) Finish v0.8.4
|\
| * c198066 (tag: v0.8.4) some commit message
* | 343af72 Finish v0.8.3
|\ \
| |/
| * 0267e30 (tag: v0.8.3) some commit message
* | 8f0ff57 some commit message
|\ \
| |/
...
(NB: the tag v0.8.4 is on a commit from branch 'develop')
How comes that when I run git describe
I get this:
v0.8.4-16-g552485a
that is, git counts 16 commits since tag v0.8.4. I'd expect it to return v0.8.4-1-g552485a
.
More specifically (when using the --debug option):
suche zur Beschreibung von HEAD
beendete Suche bei b53e85f9c8ee785c0ce50f727819b267107554fd
annotated 16 v0.8.4
annotated 17 v0.8.3
annotated 18 v0.8.2
annotated 22 v0.8
annotated 49 v0.7
annotated 60 v0.6
annotated 85 v0.5
103 Commits durchlaufen
v0.8.4-16-g552485a
Interestingly, if I switch to my develop branch:
0992f78 (HEAD -> develop, origin/develop) Some commit message.
c198066 (tag: v0.8.4) Minor change.
0267e30 (tag: v0.8.3) Minor changes.
git describe
returns as expected: v0.8.4-1-g0992f78
Background: I'm using SmartGit and its Git-Flow functionality.
Here's a graphical view of the relevant commits (red: master, blue: develop):
The number is calculated not only with the commits since the tags. In case of merging, the commits of the other branch are included too.
The documentation of git-describe
The number of additional commits is the number of commits which would be displayed by "git log v1.0.4..HEAD".