Re: [PATCH] tone down the detached head warning

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

 



On Wed, 31 Jan 2007, Jeff King wrote:

> On Wed, Jan 31, 2007 at 07:23:21PM -0800, Junio C Hamano wrote:
> 
> >         M	foo.c
> >         Switched to branch "master"
> > 	: gitster project/master; git checkout master^
> > 	M	bar.c
> >         M	foo.c
> > 	Detached your HEAD -- you are not on any branch.
> >         If you want to create a new branch from this checkout, you may do so
> >         (now or later) by using -b with the checkout command again. Example:
> >           git checkout -b <new_branch_name>
> > 	: gitster project; 
> >
> > would feel very natural and much less scary.
> 
> 
> Much improved, IMHO. As an added bonus, I think it creates some feedback
> that lets a user know when they have mistakenly used 'git checkout' to
> switch heads when they meant to restore a file.

Indeed.

> I still wish there was some other language for detaching to a commit
> specified by a remote tracking branch; it just seems wrong to say "you
> are not on any branch" right after the user requests to checkout a
> branch (admittedly not one of their local branches, but for a user
> merely poking through the repository, the difference is probably not
> important).

But this language convey the truth and users will have to get used to it 
at some point. We should not hide the fact that HEAD is really detached at
that point, otherwise it could be presumed that a commit might update the
checked out (tracking) branch which is obviously not the case.


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