# About refs refs/heads/+...

3 messages from 2014-12-21 to 2014-12-22. Participants: Duy Nguyen, Junio C Hamano.
Thread: https://gitlist.dev/t/38215

## Duy Nguyen, 2014-12-21 10:58

Subject: About refs refs/heads/+...
Message-ID: <CACsJy8B8wVKAoqaKJxuyWbyDbFEofwctyfQoU=A0S_yUMc8bgA@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8B8wVKAoqaKJxuyWbyDbFEofwctyfQoU%3DA0S_yUMc8bgA%40mail.gmail.com

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

```

## Junio C Hamano, 2014-12-21 18:40

Subject: Re: About refs refs/heads/+...
Message-ID: <xmqqy4q0c0df.fsf@gitster.dls.corp.google.com>
URL: https://gitlist.dev/e/xmqqy4q0c0df.fsf%40gitster.dls.corp.google.com
In-Reply-To: <CACsJy8B8wVKAoqaKJxuyWbyDbFEofwctyfQoU=A0S_yUMc8bgA@mail.gmail.com>

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

```

## Duy Nguyen, 2014-12-22 02:15

Subject: Re: About refs refs/heads/+...
Message-ID: <CACsJy8ABRpXv1ec14jxi7jnnZ9u2sNav8GnJCV01rFrUQ8nBSw@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8ABRpXv1ec14jxi7jnnZ9u2sNav8GnJCV01rFrUQ8nBSw%40mail.gmail.com
In-Reply-To: <xmqqy4q0c0df.fsf@gitster.dls.corp.google.com>

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

```
