Thread (1 message) 1 message, 1 author, 2016-06-15

Re: Bug: "git checkout -b" should be allowed in empty repo

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:00

Michael Haggerty [off-list ref] writes:
quoted
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".
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help