git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Nicolas Pitre <nico@cam.org>
Cc: Keith Packard <keithp@keithp.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] HEAD, ORIG_HEAD and FETCH_HEAD are really special.
Date: Fri, 07 Sep 2007 13:32:30 -0700	[thread overview]
Message-ID: <7vejha43oh.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <alpine.LFD.0.9999.0709071222270.21186@xanadu.home> (Nicolas Pitre's message of "Fri, 07 Sep 2007 12:29:01 -0400 (EDT)")

Nicolas Pitre <nico@cam.org> 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.

  reply	other threads:[~2007-09-07 20:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-06 21:48 rebase from ambiguous ref discards changes Keith Packard
2007-09-06 22:37 ` Pierre Habouzit
2007-09-06 23:26 ` Junio C Hamano
2007-09-07  2:58   ` Keith Packard
2007-09-07  6:55     ` Pierre Habouzit
2007-09-07 11:21     ` [PATCH] HEAD, ORIG_HEAD and FETCH_HEAD are really special Junio C Hamano
2007-09-07 12:36       ` Johannes Sixt
2007-09-07 12:42         ` Pierre Habouzit
2007-09-07 20:39           ` Junio C Hamano
2007-09-07 21:04             ` Pierre Habouzit
2007-09-08 22:20             ` Alex Riesen
2007-09-07 16:03         ` Keith Packard
2007-09-07 16:08       ` Keith Packard
2007-09-07 16:29         ` Nicolas Pitre
2007-09-07 20:32           ` Junio C Hamano [this message]
2007-09-07 21:53             ` Carl Worth
2007-09-07 22:08               ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vejha43oh.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=keithp@keithp.com \
    --cc=nico@cam.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).