{"thread":{"id":"19637","subject":"git checkout -b -t","startedAt":"2009-06-02T14:49:53Z","lastAt":"2009-06-02T15:25:53Z","messageCount":4,"participants":["John Tapsell","Junio C Hamano","Matthieu Moy","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"115247","messageId":"43d8ce650906020749r36a0cceao20dc54d1446a6ea@mail.gmail.com","threadId":"19637","inReplyTo":null,"subject":"git checkout -b -t","fromName":"John Tapsell","fromEmail":"johnflux@gmail.com","sentAt":"2009-06-02T14:49:53Z","receivedAt":"2009-06-02T14:49:53Z","isPatch":false,"sender":{"key":"johnflux@gmail.com","avatar":"https://gravatar.com/avatar/25f70d4c0f96396b84a2e34bcd9bdc233462c7b4be29b5fdca8266fc53f30b0c?d=mp&s=160"},"body":"Hey all,\n\n  I've become the \"guy to ask about git\" in my company and people are\nalways getting into a mess with git.  So in turn I try to get git to\nbe a more friendly.  Today someone had a problem.  Basically they had\ndone:\n\n$ git checkout -t origin/mybranch\nfatal: git checkout: --track and --no-track require -b\n\nSo they do exactly what it tells them:\n$ git checkout -b -t origin/mybranch\nSwitched to a new branch \"-t\"\n\ndoh\n\nHow can we make this less easy for people to shoot themselves in the\nfoot?  The behavior of -t has changed recently iirc, so I think that\nproblem has gone away?\n\nAlso:\n$ git branch -D -t\n\nDoesn't work.  I can see why, but it does make my life difficult :-D\n\nJohn\n"},{"id":"115248","messageId":"7vd49mhe39.fsf@alter.siamese.dyndns.org","threadId":"19637","inReplyTo":"43d8ce650906020749r36a0cceao20dc54d1446a6ea@mail.gmail.com","subject":"Re: git checkout -b -t","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-02T15:04:10Z","receivedAt":"2009-06-02T15:04:10Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"John Tapsell <johnflux@gmail.com> writes:\n\n> $ git checkout -t origin/mybranch\n> fatal: git checkout: --track and --no-track require -b\n>\n> So they do exactly what it tells them:\n> $ git checkout -b -t origin/mybranch\n> Switched to a new branch \"-t\"\n>\n> doh\n>\n> How can we make this less easy for people to shoot themselves in the\n> foot?\n\n (1) Explain things in terms of semantics, not in terms of \"brainless\n     cut&paste\" operations.\n\n (2) Avoid telling them what to do in the error messages, instead why what\n     they did is an error.\n\nE.g. \"--track/--no-track does not make sense if you are not creating a new\nbranch\" would be far less confusing in this particular case.\n"},{"id":"115249","messageId":"vpqbpp67k18.fsf@bauges.imag.fr","threadId":"19637","inReplyTo":"43d8ce650906020749r36a0cceao20dc54d1446a6ea@mail.gmail.com","subject":"Re: git checkout -b -t","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2009-06-02T15:05:55Z","receivedAt":"2009-06-02T15:05:55Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"John Tapsell <johnflux@gmail.com> writes:\n\n> $ git branch -D -t\n>\n> Doesn't work.\n\nNot really answering the question, but \"git branch -D -- -t\" should work.\n\n-- \nMatthieu\n"},{"id":"115252","messageId":"4A254481.3020104@drmicha.warpmail.net","threadId":"19637","inReplyTo":"43d8ce650906020749r36a0cceao20dc54d1446a6ea@mail.gmail.com","subject":"Re: git checkout -b -t","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-06-02T15:25:53Z","receivedAt":"2009-06-02T15:25:53Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"John Tapsell venit, vidit, dixit 02.06.2009 16:49:\n> Hey all,\n> \n>   I've become the \"guy to ask about git\" in my company and people are\n> always getting into a mess with git.  So in turn I try to get git to\n> be a more friendly.  Today someone had a problem.  Basically they had\n> done:\n> \n> $ git checkout -t origin/mybranch\n> fatal: git checkout: --track and --no-track require -b\n> \n> So they do exactly what it tells them:\n> $ git checkout -b -t origin/mybranch\n> Switched to a new branch \"-t\"\n> \n> doh\n> \n> How can we make this less easy for people to shoot themselves in the\n> foot?  The behavior of -t has changed recently iirc, so I think that\n> problem has gone away?\n\ngit 1.6.1 and above contains DWIMery which, in the case above, would\nautomatically behave like\n\ngit checkout -t origin/mybranch -b mybranch\n\nwhich complains in case 'mybranch' exists already, without pointing at\n'-b', though. Do you think this creates a new type of head aches for\nyour patients?\n\n> \n> Also:\n> $ git branch -D -t\n> \n> Doesn't work.  I can see why, but it does make my life difficult :-D\n> \n> John\n"}]}