+8

Ability to edit tags

omegatron 3 years ago updated 3 years ago 7

We can create tags and annotated tags, but there seems to be no way to view the annotation, edit the annotation, or rename the tag, other than deleting it and re-creating it.

You can see the annotation in the Branches view, the complete text will be displayed in the tooltip.

It would be nice if the tag annotation were shown in the Details box under the tag name


+1

Depending on the selected commit, the tag list already can be quite long. Showing the long tag annotation would it much harder to read. Instead it could make sense that the Details view could also work for the selected tag in the Branches view.

According to my knowledge Git does not allow to edit tags or a tag's annotation. To view the full annotation text (or copy it), please see this blog article as work-around.

+1

Yes, you have to delete it and re-create it, but it would be nice if SmartGit made it more like editing a commit or renaming a branch.

+1

There's a reason Git doesn't make this easy.

Once you have shared that tag with anyone, any edits you make will not be propagated to them.

See: https://git-scm.com/docs/git-tag#_on_re_tagging:


What should you do when you tag a wrong commit and you would want to re-tag?

If you never pushed anything out, just re-tag it. Use "-f" to replace the old one. And you’re done.

But if you have pushed things out (or others could just read your repository directly), then others will have already seen the old tag. In that case you can do one of two things:

  1. The sane thing. Just admit you screwed up, and use a different name. Others have already seen one tag-name, and if you keep the same name, you may be in the situation that two people both have "version X", but they actually have different "X"'s. So just call it "X.1" and be done with it.
  2. The insane thing. You really want to call the new version "X" too, even though others have already seen the old one. So just use git tag -f again, as if you hadn’t already published the old one.

However, Git does not (and it should not) change tags behind users back. So if somebody already got the old tag, doing a git pull on your tree shouldn’t just make them overwrite the old one.


"If you never pushed anything out, just re-tag it. Use "-f" to replace the old one. And you’re done."


I want to be able to do this in the GUI. Also to edit the annotation, etc.


SmartGit already makes it easy to move tags around to different commits by dragging them, so I don't think there's any justification for intentionally making other things more difficult than they need to be.