I have seen the commands git describe
and git-name-rev
but I have not managed to get them to list more than one tag.
Example: I have the sha1 48eb354 and I know the tags A and B point to it. So I want a git command git {something} 48eb354
that produce output similar to "A, B". I am not interested in knowing references relative other tags or branches just exact matches for tags.
git show-ref --tags -d | grep ^48eb354 | sed -e 's,.* refs/tags/,,' -e 's/\^{}//'
should work for both lightweight and annotated tags.