Re: error: src refspec refs/heads/master matches more than one.

2014-02-20 Thread Junio C Hamano
Michael Haggerty mhag...@alum.mit.edu writes: I wonder whether we could give a way to specify a reference in an unambiguous, canonical fashion like I expected, for example by using a leading slash: /refs/heads/mybranch. This could be a way for the user to ask for DWIMming to be turned off

Re: error: src refspec refs/heads/master matches more than one.

2014-02-19 Thread Michael Haggerty
On 02/18/2014 08:51 PM, Junio C Hamano wrote: John Keeping j...@keeping.me.uk writes: There's already the arbitrary set of prefixes in refs.c::prettify_refname() and refs.c::ref_rev_parse_rules(). I can see how a user might think that since git log refs/heads/name is equivalent to git log

Re: error: src refspec refs/heads/master matches more than one.

2014-02-18 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: Prevent is a strong word. I meant we only do it if they force it. Something like this.. -- 8 -- diff --git a/branch.c b/branch.c index 723a36b..3f0540f 100644 --- a/branch.c +++ b/branch.c @@ -251,6 +251,11 @@ void create_branch(const char *head,

Re: error: src refspec refs/heads/master matches more than one.

2014-02-18 Thread John Keeping
On Tue, Feb 18, 2014 at 11:03:10AM -0800, Junio C Hamano wrote: Duy Nguyen pclo...@gmail.com writes: Prevent is a strong word. I meant we only do it if they force it. Something like this.. -- 8 -- diff --git a/branch.c b/branch.c index 723a36b..3f0540f 100644 --- a/branch.c +++

Re: error: src refspec refs/heads/master matches more than one.

2014-02-18 Thread David Kastrup
Junio C Hamano gits...@pobox.com writes: Duy Nguyen pclo...@gmail.com writes: +if (!force dwim_ref(name, strlen(name), sha1, real_ref)) +die(_(creating ref refs/heads/%s makes %s ambiguous.\n + Use -f to create it anyway.), +name, name);

Re: error: src refspec refs/heads/master matches more than one.

2014-02-18 Thread Junio C Hamano
John Keeping j...@keeping.me.uk writes: There's already the arbitrary set of prefixes in refs.c::prettify_refname() and refs.c::ref_rev_parse_rules(). I can see how a user might think that since git log refs/heads/name is equivalent to git log master then git branch refs/heads/name should

Re: error: src refspec refs/heads/master matches more than one.

2014-02-18 Thread John Keeping
On Tue, Feb 18, 2014 at 11:51:05AM -0800, Junio C Hamano wrote: John Keeping j...@keeping.me.uk writes: There's already the arbitrary set of prefixes in refs.c::prettify_refname() and refs.c::ref_rev_parse_rules(). I can see how a user might think that since git log refs/heads/name is

Re: error: src refspec refs/heads/master matches more than one.

2014-02-18 Thread Junio C Hamano
David Kastrup d...@gnu.org writes: Junio C Hamano gits...@pobox.com writes: Duy Nguyen pclo...@gmail.com writes: + if (!force dwim_ref(name, strlen(name), sha1, real_ref)) + die(_(creating ref refs/heads/%s makes %s ambiguous.\n + Use -f to create it anyway.),

Re: error: src refspec refs/heads/master matches more than one.

2014-02-17 Thread Ingo Rohloff
Duy Nguyen pclouds at gmail.com writes: Prevent is a strong word. I meant we only do it if they force it. Something like this.. I would propose to make this even stronger: Forbid to create any branches which start with any of: - refs/ - heads/ - remotes/ - tags/ as long as you do not use the

Re: error: src refspec refs/heads/master matches more than one.

2014-02-15 Thread Duy Nguyen
On Fri, Feb 14, 2014 at 08:32:07AM -0800, Junio C Hamano wrote: Duy Nguyen pclo...@gmail.com writes: On Fri, Feb 14, 2014 at 7:45 PM, Andreas Schwab sch...@linux-m68k.org wrote: Josef Wolf j...@raven.inka.de writes: Notice the refs/heads _within_ refs/heads! Now I wonder how I

error: src refspec refs/heads/master matches more than one.

2014-02-14 Thread Josef Wolf
Hello folks, after some commits to my master branch, I tried to push to the bare upstream repository and got this error message: error: src refspec refs/heads/master matches more than one. A quick check shows that there's indeed something wrong: jw@kiste:/git/scan$ git branch -a | grep

Re: error: src refspec refs/heads/master matches more than one.

2014-02-14 Thread Duy Nguyen
On Fri, Feb 14, 2014 at 7:45 PM, Andreas Schwab sch...@linux-m68k.org wrote: Josef Wolf j...@raven.inka.de writes: Notice the refs/heads _within_ refs/heads! Now I wonder how I managed to get into this situation and what's the best way to recover? Probably you did something like git branch

Re: error: src refspec refs/heads/master matches more than one.

2014-02-14 Thread Josef Wolf
On Fri, Feb 14, 2014 at 07:59:18PM +0700, Duy Nguyen wrote: On Fri, Feb 14, 2014 at 7:45 PM, Andreas Schwab sch...@linux-m68k.org wrote: Josef Wolf j...@raven.inka.de writes: Notice the refs/heads _within_ refs/heads! Probably you did something like git branch refs/heads/master. You can

Re: error: src refspec refs/heads/master matches more than one.

2014-02-14 Thread David Kastrup
Josef Wolf j...@raven.inka.de writes: On Fri, Feb 14, 2014 at 07:59:18PM +0700, Duy Nguyen wrote: On Fri, Feb 14, 2014 at 7:45 PM, Andreas Schwab sch...@linux-m68k.org wrote: Josef Wolf j...@raven.inka.de writes: Notice the refs/heads _within_ refs/heads! Probably you did something

Re: error: src refspec refs/heads/master matches more than one.

2014-02-14 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: On Fri, Feb 14, 2014 at 7:45 PM, Andreas Schwab sch...@linux-m68k.org wrote: Josef Wolf j...@raven.inka.de writes: Notice the refs/heads _within_ refs/heads! Now I wonder how I managed to get into this situation and what's the best way to recover?

Re: error: src refspec refs/heads/master matches more than one.

2014-02-14 Thread David Kastrup
Junio C Hamano gits...@pobox.com writes: Duy Nguyen pclo...@gmail.com writes: On Fri, Feb 14, 2014 at 7:45 PM, Andreas Schwab sch...@linux-m68k.org wrote: Josef Wolf j...@raven.inka.de writes: Notice the refs/heads _within_ refs/heads! Now I wonder how I managed to get into this

Re: error: src refspec refs/heads/master matches more than one.

2014-02-14 Thread Josef Wolf
On Fri, Feb 14, 2014 at 04:35:14PM +0100, David Kastrup wrote: Josef Wolf j...@raven.inka.de writes: The only command in this script that uses heads is git symbolic-ref HEAD refs/heads/$new_branch You probably should check how $new_branch comes about. This is the line of code where

Re: error: src refspec refs/heads/master matches more than one.

2014-02-14 Thread Junio C Hamano
David Kastrup d...@gnu.org writes: Junio C Hamano gits...@pobox.com writes: ... A. Because it will confuse you. B. I know what I am doing. A. ??? A. But maybe Git will no longer know what you are doing. Its standard way of resolving references will mean that once a branch

Re: error: src refspec refs/heads/master matches more than one.

2014-02-14 Thread Josef Wolf
On Fri, Feb 14, 2014 at 08:32:07AM -0800, Junio C Hamano wrote: A. You are not allowed to call your branch with a string that begins with 'refs/heads/'. B. Why? A. Because it will confuse you. B. I know what I am doing. A. ??? Your reply in