Re: [PATCH] Detached HEAD (experimental)

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

 



Jeff King <peff@xxxxxxxx> writes:

> On Tue, Jan 09, 2007 at 03:46:32PM -0800, Linus Torvalds wrote:
>
>> I would suggest a solution:
>> 
>>  - git checkout will refuse to switch AWAY from a detached head unless the 
>>    SHA1 of the detached head exactly matches some other branch.
>
> What about
>
>   git checkout HEAD~20
>
> I agree that checking out tags will be more common, but it feels like we
> are discouraging this usage by presenting spurious warning messages.

Once the user knows what HEAD~20 means, I think it is safe to
assume that the user knows what the branches are.

"git checkout master" will barf and suggests the user possible
common exits; "checkout -f" if there is nothing of value,
"checkout -b <branch>" or if they want to build on the current
state.

And once the user who knows what the branches are sees such, and
especially with the help from $PS1 hack of bash-completion in
contrib/ section, the user will learn to do "checkout -f" after
wandering around for sightseeing on a detached HEAD, and at that
point the annoying error message will not be even seen.


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