On Thu, Apr 04, 2019 at 06:31:25PM +0900, Junio C Hamano wrote:

> Jeff King <[email protected]> writes:
> 
> > I do still think it is likely to be a mistake. I think Junio's point,
> > though is: who cares if the mistake was made? For the most part you can
> > continue to use the tag as if the mistake had never been made, because
> > Git peels through multiple layers as necessary.
> 
> Nicely said.
> 
> If we forget to peel, that is a bigger problem, but I do not think
> it makes any sense to single out tag-of-tag as "curious" and forbid
> it, when we silently allow tag-of-blob or tag-of-tree happily.

IMHO the difference between those cases is that it is very easy to type
something natural to get a tag of tag, like:

  git tag -m foo mytag
  # oops, try again
  git tag -m bar -f mytag mytag

but you have to take pretty specific steps to get a tag of a blob or
tree, like:

  git tag mytag HEAD:path

or

  git tag mytag HEAD^{tree}

Unless you have a ref pointing to a blob or tree in the first place, of
course. But then it is a chicken-and-egg question. Didn't you have to do
something specific to get that tag in the first place?

-Peff

Reply via email to