{"thread":{"id":"38215","subject":"About refs refs/heads/+...","startedAt":"2014-12-21T10:58:13Z","lastAt":"2014-12-22T02:15:25Z","messageCount":3,"participants":["Duy Nguyen","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"253888","messageId":"CACsJy8B8wVKAoqaKJxuyWbyDbFEofwctyfQoU=A0S_yUMc8bgA@mail.gmail.com","threadId":"38215","inReplyTo":null,"subject":"About refs refs/heads/+...","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2014-12-21T10:58:13Z","receivedAt":"2014-12-21T10:58:13Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"I accidentally created a branch whose name starts with  \"+\".\nEverything went ok until I pushed it  because \"+\" is interpreted as\nforced refspec (e.g. \"git push somewhere +wip\"). Using full ref names\nwould avoid ambiguity. The corner case of this is where the branch\nname is simply \"+\". Then refspec \"+:\" will be interpreted completely\ndifferent from what the user wants. I wonder if we could do something\nbetter:\n\n - forbid \"/+\" in ref names (too strong?)\n - some heuristics to detect \"+:\" and refuse it if ref \"+\" exists.\nheuristics to hint the user about full ref name after we fail to match\nrefspec because we misinterpret \"+\"\n - improve refspec matching code to detect ambiguation and force using\nfull ref name.\n-- \nDuy\n"},{"id":"253893","messageId":"xmqqy4q0c0df.fsf@gitster.dls.corp.google.com","threadId":"38215","inReplyTo":"CACsJy8B8wVKAoqaKJxuyWbyDbFEofwctyfQoU=A0S_yUMc8bgA@mail.gmail.com","subject":"Re: About refs refs/heads/+...","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-12-21T18:40:28Z","receivedAt":"2014-12-21T18:40:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Duy Nguyen <pclouds@gmail.com> writes:\n\n> I accidentally created a branch whose name starts with  \"+\".\n> Everything went ok until I pushed it  because \"+\" is interpreted as\n> forced refspec (e.g. \"git push somewhere +wip\"). Using full ref names\n> would avoid ambiguity. The corner case of this is where the branch\n> name is simply \"+\". Then refspec \"+:\" will be interpreted completely\n> different from what the user wants.\n\nUsing full ref names does not avoid ambiguity in that case?  What\nis a push refspec with an empty right-hand-side supposed to do in\nthe first place anyway?\n"},{"id":"253912","messageId":"CACsJy8ABRpXv1ec14jxi7jnnZ9u2sNav8GnJCV01rFrUQ8nBSw@mail.gmail.com","threadId":"38215","inReplyTo":"xmqqy4q0c0df.fsf@gitster.dls.corp.google.com","subject":"Re: About refs refs/heads/+...","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2014-12-22T02:15:25Z","receivedAt":"2014-12-22T02:15:25Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Dec 22, 2014 at 1:40 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> What is a push refspec with an empty right-hand-side supposed to do in\n> the first place anyway?\n\nError out. My bad.\n-- \nDuy\n"}]}