git describe --tags
をリポジトリに実行すると、コミットが両方のブランチにあるように見えても、ブランチの1つに最新のタグが報告されなくなります。git describe --tagsが正しいタグを報告していない
これがどのように発生したか、それをどのように解決してタグが開発ブランチでも利用できるようになる人は誰も知りませんか?開発ブランチから
$ git tag
...
2.7.1
2.7.2
2.7.3
2.7.4
$ git checkout develop
$ git describe --tags --abbrev=0
2.7.2
$ git rev-list -n 1 2.7.4
d700ec90cd7a82be076c1b69b0815a3dab4597ac
$ git rev-list -n 1 2.7.2
79c161b96541da2d039e0cef649044f57387fa8d
$ git cat-file -t 2.7.2
commit
$ git cat-file -t 2.7.4
commit
$ git merge master
Already up-to-date.
$ git branch --contains d700ec90cd7a82be076c1b69b0815a3dab4597ac
* develop
master
$ git describe --tags --abbrev=0
2.7.2
$ git log 2.7.4..HEAD
# shows the proper log even on develop (where the tag doesn't exist according to describe)
$ git checkout master
$ git describe --tags --abbrev=0
2.7.4
:
$ git describe --tags --abbrev=0 --debug
searching to describe HEAD
lightweight 580 2.7.2
lightweight 613 2.7.1
lightweight 618 2.7.0
lightweight 791 2.6.0
lightweight 1134 2.5.2
lightweight 1210 2.5.1
lightweight 1345 2.5.0
lightweight 1464 2.4.4
lightweight 1597 2.7.4
lightweight 1597 2.7.3
traversed 1600 commits
more than 10 tags found; listed 10 most recent
gave up search at f3a739ef25d49556538e990c110df3f465e29fa3
2.7.2
masterブランチから:
$ git describe --tags --abbrev=0 --debug
2.7.4
開発ブランチから(切り捨て):
$ git log --graph --decorate --oneline --all --simplify-by-decoration
* c813804fd (HEAD -> develop, origin/develop, origin/HEAD) Merge pull request #3070
* d700ec90c (tag: 2.7.4, origin/master, master) Bump version: 2.7.3 → 2.7.4
* ce8e6b8a9 (tag: 2.7.3) Bump version: 2.7.2 → 2.7.3
* 79c161b96 (tag: 2.7.2) Bump version: 2.7.1 → 2.7.2
* 17aa75b5a (tag: 2.7.1) Bump version: 2.7.0 → 2.7.1
* e4b0d4c7e (tag: 2.7.0) Bump version: 2.6.0 → 2.7.0
'git describe --tags --abrev = 0 --debug'を表示できますか? –
@AnthonySottileがその出力を含むように更新されました。 – hatch