Re: [PATCH] HEAD, ORIG_HEAD and FETCH_HEAD are really special.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nicolas Pitre <nico@xxxxxxx> writes:

>> It seems to me that instead of introducing an incompatible (but probably
>> useful) change, a sensible option would be to have the ambiguous
>> reference be an error instead of a warning. One shouldn't be encouraged
>> to use names in .git that conflict with stuff in refs/heads anyway.
>
> I agree.  IMHO the sensible thing to do is to always warn, and error out 
> by default.  I see no advantage for core.warnAmbiguousRefs=false other 
> than allow the user to shoot himself in the foot someday.  Instead, we 
> should have core.allowAmbiguousRefs set to off by default.

Well, for about three weeks late November to early December
2005, we did make this an error.  Since mid December 2005, we
reverted that change to the original "take first match, without
even attempting to detect ambiguity".  I do not recall what the
discussion that led to that change was about, but it could have
been the issue Len had that confused "git merge" with a tag and
a branch named after bugzilla bug number.  In any case, this
change most likely was because some people were actually using
the same name and the change to make it an error hurted them.

We then reintroduced the ambiguity detection late March 2006,
but only as a warning, again fearing that erroring out would
break people's existing setups.  I think we also rewrote
examples in our documentation that said "create your own branch
v2.6.13 that fork from v2.6.13 tag" to read "create your own
brancy my-2.6.13..." to avoid encouraging the use of same name
to people.

I think the warning has been with us for a long time and by now
people know better not to confuse themselves.

So I am all for making an ambiguous refname an error in 1.5.4.

At the same time, I think it makes sense to forbid update-ref
outside refs/ if the refname is not special (say, with any
lowercase letters), and ignore names immediately below .git that
are not all-uppercase+underscore (e.g. "FETCH_HEAD" we read,
"description" we ignore).

Please make it so.

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux