How do I add the output of
# Get tag distance $(TAGDIST)
git describe --tags | \
awk '{split($0,TagNameWithTagDist,"-g");
i=split(TagNameWithTagDist[1],TagDist,"-");
print(TagDist[i]);}'
to the output of the following?
git log --graph --format=format:'%h - %s + $TAGDIST'
I don’t see in the “Pretty Formats” section of the git-log documentation a placeholders that corresponds to this value. Placeholder %d shows the tag name on the commit where it was created only.
Copy the code below as a file named
git-logtagdistin some directory in your path. Note that it runs slowly because it forks a newgit-describeprocess for each commit. You could speed it up by batching thegit-describeruns.Sample output: