Re: [PATCH] Detached HEAD (experimental)
- From
- Andy Parkins <andyparkins@gmail.com>
- Date
- Jan 10, 2007, 10:10 UTC
- Message-ID
- <200701101010.46269.andyparkins@gmail.com>
- In-Reply-To
- <7vbql7cjk8.fsf@assigned-by-dhcp.cox.net>
On Wednesday 2007 January 10 09:33, Junio C Hamano wrote:
Show 9 quoted lines
> > 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@gmail.com