2017-07-11 6 views
0

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 
+0

'git describe --tags --abrev = 0 --debug'を表示できますか? –

+0

@AnthonySottileがその出力を含むように更新されました。 – hatch

答えて

0

git log --graph --decorate --oneline --all --simplify-by-decorationはあなたが表示されます骨格あなたのレポに含まれるものの概要。その出力はあなたの質問に対する最良の答えになります。あなたが頻繁に使用する羽目になるコマンドの

Gitの別名は、人生は非常に便利な作り方

git config alias.lgdo '!f() { git log --graph --decorate --oneline "${@---all}"; }; f' 

作品にまで勉強して、あなたは再び飢えることは決してないだろう。


まあ、大丈夫、多分。しかしエイリアスやシェル関数、エイリアス内のシェル関数、Git R Dunのように作業を簡単かつ迅速に行うためのすべての関連方法は学ぶ価値があります。

+0

ありがとう、私はそのコマンドから切り詰められた出力を含めるように質問を更新しました。私は2.7.4タグが残りのものと異なっているのを見る間、2.7.3は残りのものと同一であり、返されません。 – hatch

+0

どこにでも頭が見えません。私はHEADを表示しない '--graph --all'ログをどのように生成するのか分かりません。どうしましたか? – jthill

+0

あまりにも切り詰めて申し訳ありませんが、追加されました – hatch

関連する問題