removing "tag" details from git with a covering manuscript

The vc bundle is a cool little plan that removes details concerning a git repo for very easy insertion right into a LaTeX record. It does not presently extract details concerning whether the existing devote is marked and also what the tag name is. Just how would certainly I modify the vc manuscript to do this?

And afterwards just how would certainly I modify the vc-git.awk manuscript to add an added line to the created vc.tex documents? Probably I desire a line that resembles:

print "\\gdef\\GITTag{" Tag "}%"

yet I require an earlier line that informs awk what " Tag " suggests?

This isn't an inquiry concerning LaTeX, it has to do with git, awk and also bash ...

0
2019-05-13 05:55:30
Source Share
Answers: 3

You can get what devote tag indicate by:

git show -s 'TAG_NAME^{commit}' --format='%H'

Unfortunatly I'm worried that the only means of examining if devote is marked it to examine all tags.

0
2019-05-17 19:47:54
Source

You can obtain from a devote to a tag name by utilizing name-rev.

git name-rev <commit> --tags

An instance:

$ git name-rev fcfeabe --tags
fcfeabe tags/v2.36-beta2

So to get just the tag:

git name-rev fcfeabe --tags | awk '{sub("tags/", ""); print $2}' 
0
2019-05-17 15:58:18
Source
git log --decorate -1 [commit]

If commit (HEAD if left out) has tags, the devote hash will certainly be adhered to by (tag: name) (and also perhaps numerous various other symbolic referrals also). You can select this out extra especially with

git log --pretty=%d
0
2019-05-17 15:46:42
Source