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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Uri Okrent <uokrent@xxxxxxxxx> writes:

> 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?

You already get reminded that you were on a detached HEAD in step #3.

The primary point of the message you are replying to was that I do not
agree with the view that step #3 is the most problematic step.  The
existing reminder would help people who read it and are capable of
realizing "ah, I started it on a throw-away branch but ended up with
something I would rather keep" and doing "git branch topic HEAD@{1}".  

It will not help people who haven't got enough clue yet to know what a
detached HEAD is, or you can refer to your previous point with HEAD@{1}
notation.  We do give brief advice at step #1 to alleviate this issue.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]