It is related to Making git show to show information in a machine parseable format but I am getting tired of the fact that I now have to do a lot of parsing to get the commit hash.
Can someone give me a command that will print the commit hash (and only the commit hash) tag for a given git tag? I was hoping
git show mylabel --pretty=format:"%H" --quiet
Would just print me my commit # but it says
tag mylabel
Tagger: user <user@x.com>
Some comment
446a52cb4aff90d0626b8232aba8c40235c16245
I was expecting one line of output with just the commit line but I now have to parse for the last line?