Subject: Re: [PATCH/RFC] builtin-checkout: suggest creating local branch when appropriate to do so

From: Uri Okrent <[email-masked]>
Date: Sun, 25 Oct 2009 10:48:56 -0700

Junio C Hamano wrote:
> In this sequence:
> 
>     1$ git checkout $commit_name_that_is_not_a_local_branch
>     2$ git commit; hack; hack; hack;...
>     3$ git checkout $branch_name
> [...]
> Step #3 is where the state built in the detached HEAD "branch" vanishes
> into lost-found.
> 
> The experts argued that #3 is where it is dangerous...

If step 3 is where the danger lies, wouldn't it then be most appropriate to put
the warning message there? I.e., warn or refuse to switch branches when
currently on a detached head containing new commits, kind of like branch -d's
cowardliness.
-- 
    Uri

Please consider the environment before printing this message.
http://www.panda.org/how_you_can_help/