Every git tutorial you look into has a clear opinion about tags: One should always use annotated tags, one of the reasons being that they are used by git describe
.
However, I don’t see anything bad in using git describe --tags
which also takes the unannotated tags as a reference point. Is there anything else that’s considered bad about unannotated tags?
I’m asking because I’ve just finished converting a SVN project to git. I was actually thinking about providing the tags with an annotation but what should I’ve put there if not an alarmingly redundant ‘Tagging release 1.5 for our project’ message (which had been used as an SVN comment already anyway)?
Annotated tags seem like a nice thing to me (you can tag things as a different author and might give a short description), but should you really use them even in cases when you don’t have anything meaningful to say apart from the original commit message?
or
In which situations are unannotated tags not frowned upon?
Edit: I’m not talking about signed annotated tags (I understand the advantage of having signed tags in some situations); I’m only concerned about the difference between unannotated and unsigned annotated.
Edit 2: Appending another question to broaden the scope somewhat and maybe get some insightful answers about the real-life best-bractices
When do you use unannotated tags and do you feel bad about it when you do?
The difference between the commands is that one provides you with a tag message while the other doesn't. An annotated tag has a message that can be displayed with git-show(1), while a tag without annotations is just a named pointer to a commit.
Git supports two types of tags: lightweight and annotated. A lightweight tag is very much like a branch that doesn't change — it's just a pointer to a specific commit. Annotated tags, however, are stored as full objects in the Git database.
Annotated tags are stored as full objects in the Git database. To reiterate, They store extra meta data such as: the tagger name, email, and date. Similar to commits and commit messages Annotated tags have a tagging message.
To create a lightweight tag, all you need to provide is a tag name. You don't need to include any of the flags you would see with annotated tags (see below). If we run git show on this tag, we simply see the commit hash, the author, the date, and the commit message.
An annotated tag is actually a tag object. It has an author, a description, a timestamp and points to a commit.
A lightweight tag points to a commit and contains no other information. It's got more in common with branching than with tagging.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With