Re: Bug: "git checkout -b" should be allowed in empty repo
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 6, 2012, 18:31 UTC
- Message-ID
- <7vliof7r0n.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <4F2F9661.2020606@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
Show 13 quoted lines
>> So we are breaking the equivalence between these three only when HEAD >> points at an unborn branch. > > You are thinking too much like a developer and not like a user. For a user, > > git checkout -b foo > > is a short-hand for > > "create and check out a branch at my current state" > > and the interpretation of what that means when I am on an unborn branch > seems unambiguous.
Ok, that is a very good explanation.
Care to come up with a patch to Documentation/git-checkout.txt? The description there strongly implies that <start point> is an existing commit. Not much is said about what the lack of <start point> mean when it describes "checkout -b", and a standalone description of <start point> says "The name of a comit at which to start... Defaults to HEAD". These need to be loosened and described in terms of the closer-to-the-user "at my current state".