Subject: Re: [PATCH v2 1/5] replace: forbid replacing an object with one of a different type

From: Junio C Hamano <[email-masked]>
Date: Tue, 27 Aug 2013 13:30:03 -0700

Christian Couder <[email-masked]> writes:

> Users replacing an object with one of a different type were not
> prevented to do so, even if it was obvious, and stated in the doc,
> that bad things would result from doing that.
>
> To avoid mistakes, it is better to just forbid that though.
>
> There is no case where one object can be replaced with one of a
> different type while keeping the history valid, because:
>
> * Annotated tags contain the type of the tagged object.

If you replace the tagged object and the tag at the same time,
wouldn't that make the resulting history valid again?

Granted, there may not be a strong reason to reuse the object name
of the tagged object in such a case, but this "there may not be" is
merely "I do not think of offhand", so I am not sure what workflow
of other people we are breaking with this change.  A light-weight
tag may already point at the tagged object (in other words, the
object name of the tagged object is known to the outside world) and
that could be a reason why you would need to reuse the object name
of that object while changing its type.

I dunno.