show all tags in git log

前端 未结 3 1449
一生所求
一生所求 2021-01-30 11:59

Why does git log --decorate not display more than one tag per commit?

EDIT: Charles Bailey has come up with the answer (at

3条回答
  •  心在旅途
    2021-01-30 12:48

    Note: the commit 5e1361c from brian m. carlson (bk2204) (for git 1.9/2.0 Q1 2014) deals with a special case in term of log decoration with tags:

    log: properly handle decorations with chained tags

    git log did not correctly handle decorations when a tag object referenced another tag object that was no longer a ref, such as when the second tag was deleted.
    The commit would not be decorated correctly because parse_object had not been called on the second tag and therefore its tagged field had not been filled in, resulting in none of the tags being associated with the relevant commit.

    Call parse_object to fill in this field if it is absent so that the chain of tags can be dereferenced and the commit can be properly decorated.
    Include tests as well to prevent future regressions.

    Example:

    git tag -a tag1 -m tag1 &&
    git tag -a tag2 -m tag2 tag1 &&
    git tag -d tag1 &&
    git commit --amend -m shorter &&
    git log --no-walk --tags --pretty="%H %d" --decorate=full
    

提交回复
热议问题