On Mon, Mar 25, 2019 at 9:49 AM Jeff King <peff@xxxxxxxx> wrote: > I think "just commits" is too restrictive. linux.git contains a tag of a > tree, for example (we also have tags pointing to blobs in git.git, but > they are not annotated). > > However, I could see an argument for the git-tag porcelain to notice a > tag-of-tag and complain. Probably peeling the tag automatically is a bad > idea, just because it behaved differently for so long. But something > like might be OK: > > $ git tag -a mytag > error: refusing to make a recursive tag > hint: The object 'mytag' referred to by your new tag is already a tag. > hint: > hint: If you meant to create a tag of a tag, use: > hint: > hint: git tag -a -f mytag > hint: > hint: If you meant to tag the object that it points to, use: > hint: > hint: git tag -a mytag^{} > > It would be a minor annoyance to somebody who frequently makes > tags-of-tags, but it leaves them with an escape hatch. I think a warning/error would be perfect. Again, if I had realized the consequences of my actions years ago when I made this tag, it would have changed a lot down the line for me. If I had seen that message before, I think it would have helped a lot. You might even add an educational bit in there and say "Warning: You are creating an annotated tag that points to another annotated tag. Annotated tags may point to more than just commits by design. Refspec tag^{} may be used to peel the source tag back to the commit it points to". Then follow with the instructional commands. I agree with your approach though. Thanks again.