TieDad
TieDad

Reputation: 9889

Why git taggerdate is empty?

I'm trying to sort git tag. Via Google search, I found a lot of posts are talking about taggerdate, but in my repo, taggerdate is always empty:

$ /usr/bin/git for-each-ref --format "%(refname) | %(subject)| %(taggerdate) | %(authordate)" refs/tags
refs/tags/hello | Merge branch 'featureY' into 'master'|  | Sun Jan 19 23:36:30 2020 -0800
refs/tags/v3.0 | Revert "aaaaaaa"|  | Wed Jul 3 15:09:20 2019 +0800
refs/tags/v4.0 | feat: a big enhancement|  | Wed Jul 3 15:12:49 2019 +0800
refs/tags/v5.0 | feat: hello world. Closed [RNWY-56].|  | Wed Jul 3 15:29:13 2019 +0800
refs/tags/v6.0 | feat: hello world. Closes [RNWY-56].|  | Wed Jul 3 15:29:13 2019 +0800

My git version is:

$ /usr/bin/git --version
git version 2.21.0 (Apple Git-120)

How taggerdate is created?

Upvotes: 4

Views: 826

Answers (1)

phd
phd

Reputation: 94425

These are lightweight tags created with git tag instead of git tag -a (annotated tags). Lightweight tags don't have taggerdate. You can use creatordate format to extract either taggerdate from an annotated tag or committerdate from a lightweight tag.

See https://git-scm.com/docs/git-for-each-ref

Upvotes: 6

Related Questions