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

2016-03-23 Thread Duy Nguyen
I'm digging this topic up from the ground because if it was fixed, I would not have spent many confusing (and a little bit panicking) minutes wondering how the hell I managed to push to "origin/master" which I did not have push access to begin with, which turned out to be the local branch, refs/hea

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

2014-02-20 Thread Junio C Hamano
Michael Haggerty 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 without having to

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 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

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

2014-02-18 Thread Junio C Hamano
David Kastrup writes: > Junio C Hamano writes: > >> Duy Nguyen 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,

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 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 > > equival

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

2014-02-18 Thread Junio C Hamano
John Keeping 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 > be equiva

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

2014-02-18 Thread David Kastrup
Junio C Hamano writes: > Duy Nguyen 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); > > Does this check s

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 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 Junio C Hamano
Duy Nguyen 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-17 Thread Ingo Rohloff
Duy Nguyen 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 th

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 writes: > > > On Fri, Feb 14, 2014 at 7:45 PM, Andreas Schwab > > wrote: > >> Josef Wolf writes: > >> > >>> Notice the refs/heads _within_ refs/heads! > >>> > >>> Now I wonder how I managed to get into this situation

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 http://git.661346.n2.nabble.com/1-8-

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

2014-02-14 Thread Junio C Hamano
David Kastrup writes: > Junio C Hamano 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 > refs/heads/wibble exists, ref

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 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 $new_br

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

2014-02-14 Thread David Kastrup
Junio C Hamano writes: > Duy Nguyen writes: > >> On Fri, Feb 14, 2014 at 7:45 PM, Andreas Schwab >> wrote: >>> Josef Wolf 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 Junio C Hamano
Duy Nguyen writes: > On Fri, Feb 14, 2014 at 7:45 PM, Andreas Schwab wrote: >> Josef Wolf 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 "g

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

2014-02-14 Thread David Kastrup
Josef Wolf 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 >> wrote: >> > Josef Wolf writes: >> > >> >> Notice the refs/heads _within_ refs/heads! >> > Probably you did something like "git branch refs/heads/master". You

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 wrote: > > Josef Wolf writes: > > > >> Notice the refs/heads _within_ refs/heads! > > Probably you did something like "git branch refs/heads/master". You can > > remove it again with "gi

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 wrote: > Josef Wolf 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 refs/heads/master". You c

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

2014-02-14 Thread Andreas Schwab
Josef Wolf 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 refs/heads/master". You can remove it again with "git branch -d refs/heads/master". Andrea

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 |