Display a list of vivid tags on git

I have the following git aliases:

 lo = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short -n 8

How can I display a list of all git tags with a fancy format like the one above instead of a tag name such as a call git tag?

+3
source share
1 answer

I don't have a neat answer to this question, but you can create a shell alias for something like this:

for t in $(git tag -l)
do
    printf "%-16s" $t
    echo `git show -s --pretty=format:"%h %ad | %s%d [%an]" --date=short $t^{}`
done

... which on the main git repository will produce output, for example:

v1.7.9          828ea97 2012-01-27 | Git 1.7.9 (v1.7.9) [Junio C Hamano]
v1.7.9-rc0      eac2d83 2012-01-06 | Git 1.7.9-rc0 (v1.7.9-rc0) [Junio C Hamano]
v1.7.9-rc1      6db5c6e 2012-01-12 | Git 1.7.9-rc1 (v1.7.9-rc1) [Junio C Hamano]
v1.7.9-rc2      bddcefc 2012-01-18 | Git 1.7.9-rc2 (v1.7.9-rc2) [Junio C Hamano]
v1.7.9.1        90020e3 2012-02-14 | Git 1.7.9.1 (v1.7.9.1) [Junio C Hamano]
v1.7.9.2        78f4c9f 2012-02-22 | Git 1.7.9.2 (v1.7.9.2) [Junio C Hamano]
v1.7.9.3        69f4e08 2012-03-05 | Git 1.7.9.3 (v1.7.9.3) [Junio C Hamano]
v1.7.9.4        a460348 2012-03-12 | Git 1.7.9.4 (v1.7.9.4) [Junio C Hamano]
v1.7.9.5        8ced9c9 2012-03-26 | Git 1.7.9.5 (v1.7.9.5) [Junio C Hamano]
v1.7.9.6        cb2ed32 2012-04-02 | Git 1.7.9.6 (v1.7.9.6) [Junio C Hamano]
v1.7.9.7        d0f1ea6 2012-04-26 | Git 1.7.9.7 (v1.7.9.7) [Junio C Hamano]

An unobvious bit for me is the suffix ^{}in the tag name, which means dereferencing any tag object to find the commit that it points to, as described in the git rev-parseman page .

+4
source

All Articles