Re: [PATCH] Detached HEAD (experimental)

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

 



On Wednesday 2007 January 10 09:33, Junio C Hamano wrote:

> > If the detached HEAD matches another branch what did we need a detached
> > HEAD for in the first place?
> >
> > Seems that this check will in practice always be true.  A detached HEAD
> > by definition doesn't match some other branch.
>
> You are forgetting this:
>
> 	git checkout v1.0.0

No I'm not.  Linus's suggested check is "git checkout will refuse to switch 
AWAY from a detached head unless the SHA1 of the detached head exactly 
matches some other branch."

My question is what use is that?  In exactly the situation you describe HEAD 
doesn't match a branch.

  git checkout v1.0.0

HEAD after that doesn't match any branch so the next "git checkout" will find 
that HEAD doesn't match any branch and will refuse to switch away.  Why?  A 
checkout in this case isn't dangerous at all.

Of course I could still be misunderstanding.  If Linus meant "refuse to switch 
AWAY from a detached HEAD unless the hash of the detached head exactly 
matches some other ref", I would be less confused.


Andy
-- 
Dr Andy Parkins, M Eng (hons), MIEE
andyparkins@xxxxxxxxx
-
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]