{"thread":{"id":"39954","subject":"Fwd: Bug#793884: git: allows nonsensical command 'git checkout -b HEAD'","startedAt":"2015-07-28T14:33:14Z","lastAt":"2015-07-28T16:32:39Z","messageCount":2,"participants":["Duy Nguyen","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"266926","messageId":"CACsJy8Atx7h8LHQ26rTx2jPUxL-+MSLva8njdoUs5+Aq-Eoj4Q@mail.gmail.com","threadId":"39954","inReplyTo":"20150728141858.22342.16605.reportbug@zam581.zam.kfa-juelich.de","subject":"Fwd: Bug#793884: git: allows nonsensical command 'git checkout -b HEAD'","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2015-07-28T14:33:14Z","receivedAt":"2015-07-28T14:33:14Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"This seems like a good thing to fix (i.e. make sure XX is not\nambiguous before creating it with \"git checkout -b XX\")\n\n\n---------- Forwarded message ----------\nFrom: Andreas Beckmann <anbe@debian.org>\nDate: Tue, Jul 28, 2015 at 9:18 PM\nSubject: Bug#793884: git: allows nonsensical command 'git checkout -b HEAD'\nTo: Debian Bug Tracking System <submit@bugs.debian.org>\n\n\nPackage: git\nVersion: 1:2.1.4-2.1\nSeverity: normal\nTags: upstream\n\n$ git branch HEAD\nfatal: it does not make sense to create 'HEAD' manually\n# OK, special casing prevents this\n$ git checkout -b HEAD\nSwitched to a new branch 'HEAD'\n# but not this :-P\n$ git checkout master\nSwitched to branch 'master'\n$ git checkout HEAD\nwarning: refname 'HEAD' is ambiguous.\nSwitched to branch 'HEAD'\n# oops ;-)\n$ git checkout master\nSwitched to branch 'master'\n$ git branch -d HEAD\nDeleted branch HEAD (was 6e54945).\n# OK, we can easily cleanup this mess again\n\nThe same works in 1:2.4.6-1 in sid.\n\nIf there is some special casing for HEAD in git branch, the same\nshould probably be done for git checkout -b, too.\n\n\nAndreas\n\n\n\n-- \nDuy\n"},{"id":"266938","messageId":"xmqqmvygfdjs.fsf@gitster.dls.corp.google.com","threadId":"39954","inReplyTo":"CACsJy8Atx7h8LHQ26rTx2jPUxL-+MSLva8njdoUs5+Aq-Eoj4Q@mail.gmail.com","subject":"Re: Fwd: Bug#793884: git: allows nonsensical command 'git checkout -b HEAD'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-07-28T16:32:39Z","receivedAt":"2015-07-28T16:32:39Z","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> This seems like a good thing to fix (i.e. make sure XX is not\n> ambiguous before creating it with \"git checkout -b XX\")\n\nYeah, sounds like an easy lunch-time hack low-hanging fruit :-).\n"}]}