git/list[1] front-page[2] threads[3] people[4] search[5] about
 

About refs refs/heads/+...

From
Duy Nguyen <pclouds@gmail.com>
Date
Dec 21, 2014, 10:58 UTC
Message-ID
<CACsJy8B8wVKAoqaKJxuyWbyDbFEofwctyfQoU=A0S_yUMc8bgA@mail.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
Next: Junio C Hamano
Message 1 of 3 in “About refs refs/heads/+...”
  1. Duy NguyenDec 21, 2014
  2. Junio C HamanoDec 21, 2014
  3. Duy NguyenDec 22, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.