Re: [PATCH] Documentation: add a planning document for the next CLI revamp
- From
Sam Vilain <sam@vilain.net>
- Date
- Oct 30, 2008, 23:28 UTC
- Message-ID
- <1225409309.6765.5.camel@maia.lan>
- In-Reply-To
- <alpine.LFD.2.00.0810301423520.13034@xanadu.home>
On Thu, 2008-10-30 at 14:28 -0400, Nicolas Pitre wrote:
> > For the case where the thing you type is a resolvable reference, it > > would just check it out, as now. > As long as it checks it out with a detached head if it is a remote > branch then I have no issue.
Absolutely - if you've already got a branch "master", then "git checkout master" should definitely give it to you. If you go "git checkout origin/master", you get a floating head. But I quite often find myself wanting to check out a remote branch, and give it a name just like on the remote. I want "git checkout blah" to assume that's what I mean, until I make a local branch "blah".
> By default, git creates a branch called "master. Hence, by default, if > you clone that repository, this branch will be called origin/master. So > by default $foo is already ambiguous.
Right - 'master' in this case resolves to something. The ambiguity is resolved by defaulting to the thing that resolves. The fall-back behaviour is only triggered if you asked for something that is currently an error. Because breaking expectations sucks.
Sam.