git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* About refs refs/heads/+...
@ 2014-12-21 10:58 Duy Nguyen
  2014-12-21 18:40 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Duy Nguyen @ 2014-12-21 10:58 UTC (permalink / raw)
  To: Git Mailing List

I accidentally created a branch whose name starts with  "+".
Everything went ok until I pushed it  because "+" is interpreted as
forced refspec (e.g. "git push somewhere +wip"). Using full ref names
would avoid ambiguity. The corner case of this is where the branch
name is simply "+". Then refspec "+:" will be interpreted completely
different from what the user wants. I wonder if we could do something
better:

 - forbid "/+" in ref names (too strong?)
 - some heuristics to detect "+:" and refuse it if ref "+" exists.
heuristics to hint the user about full ref name after we fail to match
refspec because we misinterpret "+"
 - improve refspec matching code to detect ambiguation and force using
full ref name.
-- 
Duy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: About refs refs/heads/+...
  2014-12-21 10:58 About refs refs/heads/+ Duy Nguyen
@ 2014-12-21 18:40 ` Junio C Hamano
  2014-12-22  2:15   ` Duy Nguyen
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2014-12-21 18:40 UTC (permalink / raw)
  To: Duy Nguyen; +Cc: Git Mailing List

Duy Nguyen <pclouds@gmail.com> writes:

> I accidentally created a branch whose name starts with  "+".
> Everything went ok until I pushed it  because "+" is interpreted as
> forced refspec (e.g. "git push somewhere +wip"). Using full ref names
> would avoid ambiguity. The corner case of this is where the branch
> name is simply "+". Then refspec "+:" will be interpreted completely
> different from what the user wants.

Using full ref names does not avoid ambiguity in that case?  What
is a push refspec with an empty right-hand-side supposed to do in
the first place anyway?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: About refs refs/heads/+...
  2014-12-21 18:40 ` Junio C Hamano
@ 2014-12-22  2:15   ` Duy Nguyen
  0 siblings, 0 replies; 3+ messages in thread
From: Duy Nguyen @ 2014-12-22  2:15 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git Mailing List

On Mon, Dec 22, 2014 at 1:40 AM, Junio C Hamano <gitster@pobox.com> wrote:
> What is a push refspec with an empty right-hand-side supposed to do in
> the first place anyway?

Error out. My bad.
-- 
Duy

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-22  2:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-21 10:58 About refs refs/heads/+ Duy Nguyen
2014-12-21 18:40 ` Junio C Hamano
2014-12-22  2:15   ` Duy Nguyen

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 NNTP newsgroup(s).