It seems easy to list all tags with annotations, with e.g.:
git tag -n99
or
git for-each-ref --format '%(refname:short) %(contents)' refs/tags
And it's also possible to use git log to list tags by creator date, e.g. (from here):
git log --tags --simplify-by-decoration --pretty="format:%cs %d"
However, neither of these answer the question, because as far as I can tell:
- it is not possible to sort annotated tags by commit date with
git tag, because the tags point to a tag annotation object, and socommitterdateis empty. You can confirm this withgit tag --format='%(committerdate)'- There is a
creatordate, which lists the commit date for un-annotated commits, and the tag creation date for annotated commits, which is also useless for this question.
- There is a
- it is not possible to show the tag annotations with
git log, because there is no tag annotation option in the formatter (and this wouldn't make sense anyway, because a single commit can have multiple tags.
So, is there a way to do this that lists all tags, sorted by commit date, and showing both commit date and annotations? I don't care about unannotated tags for this question.