git描述:莫名的提交计数 [英] git describe: inexplicable commit count

查看:120
本文介绍了git描述:莫名的提交计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

考虑下面这段 git log --oneline --decorate --graph

  * 552485a(HEAD  - > master,origin / master)完成v0.8.4 
| \
| * c198066(tag:v0.8.4)一些提交消息
* | 343af72 Finish v0.8.3
| \\
| | /
| * 0267e30(tag:v0.8.3)一些提交消息
* | 8f0ff57一些提交消息
| \\
| | /
...



<注意:标签v0.8.4在提交从分支'开发')



当我运行 git describe 时我是如何得到这个的:

  v0.8.4-16-g552485a 

也就是说,自从tag v0.8.4以后,git会计数16次提交。我希望它会返回 v0.8.4-1-g552485a

更详细地说(当使用 - -debug选项):

  suche zur Beschreibung von HEAD 
beendete Suche bei b53e85f9c8ee785c0ce50f727819b267107554fd
annotated 16 v0。 8.4
注释17 v0.8.3
注释18 v0.8.2
注释22 v0.8
注释49 v0.7
注释60 v0.6
注释85 v0.5
103提交durchlaufen
v0.8.4-16-g552485a



<有趣的是,如果我切换到我的开发分支:

  0992f78(HEAD  - > develop,origin / develop)信息。 
c198066(tag:v0.8.4)稍作修改。
0267e30(tag:v0.8.3)稍作修改。

git describe 按预期返回:v0。 8.4-1-g0992f78

背景:我正在使用SmartGit及其Git-Flow功能。



以下是相关提交的图形视图(红色:master,blue:develop):

解决方案

在合并的情况下,其他分支的提交也包括在内。

git-describe
$ b


额外提交的数量是提交的数量,将显示为git log v1.0.4..HEAD。



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

这篇关于git描述:莫名的提交计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆