From: Mikael Magnusson Date: Tue, 06 Oct 2009 09:41:07 GMT Subject: Re: [PATCH/RFC] builtin-checkout: suggest creating local branch when appropriate to do so Message-ID: <237967ef0910060241q671baafav93fe6402a4c510c5@mail.gmail.com> In-Reply-To: 2009/10/6 Matthieu Moy : > Johannes Schindelin writes: > >> Hi, >> >> On Mon, 5 Oct 2009, Jeff King wrote: >> >>> Some devil's advocate questions: >>> >>> 1. How do we find "origin/next" given "next"? What are the exact >>> lookup rules? Do they cover every case? Do they avoid surprising >>> the user? >> >> I am sure your strategy would be the same as mine: enumerate all remote >> branches, strip the remote nickname, and compare. If there are >> ambiguities, tell the user and stop. >> >>> 2. What do we do if our lookup is ambiguous (e.g., "origin/next" and >>> "foobar/next" both exist)? >> >> See above. > > One problem with this approach is that if users get used to the > behavior, the command will have great probability to end up in a > user's script, then the script will "work" as long as there is no > ambiguity, and cease to work afterwards. And for the user of the > script, this will sound like "WTF, it was working yesterday and it's > broken now". > > So, the good thing with being strict, even if giving advice in case of > failure, is that it teaches the user the reliable way to do. I can imagine this happening: % git clone git://git.git git % git checkout next do you want to checkout origin/next? y # a few days later % git fetch % git checkout next [freenode] /join #git [#git] i did git checkout next but my files are still the same? -- Mikael Magnusson