On Tue, 9 Jan 2007 15:46:32 -0800 (PST), Linus Torvalds wrote: > - git checkout will refuse to switch AWAY from a detached head unless the > SHA1 of the detached head exactly matches some other branch. That's a nice cheap check. But I've also been liking the idea of using this "detached head" stuff for git-bisect, (instead of making it carry around its own temporary branch). One long-standing user-interface bug with git-bisect is that often the user doesn't know a priori what the last-known-good state is to initially mark with "git bisect good". So I've long wanted a good clean way to explore fairly arbitrarily in order to get git-bisect jump started. When I first started using git a year ago, what was suggested to me for this, (and what I've used ever since), is: git checkout -b tmp some-guess-at-a-good-commit # check it git reset --hard next-guess-at-a-good-commit Obviously, that works but fails the "good clean" test for me. Half the time it fails for me and I have to "git branch -D tmp" first. Then there's the fact that I want very new users to learn git-bisect---I want random users that have hit bugs in my software to bisect those bugs for me---and many of these users will have never seen git before. I don't think it's kind to start their education with "git reset --hard". I'd like to instead teach them something as simple as: git checkout some-guess-at-a-good-commit # check it git checkout next-guess-at-a-good-commit I wouldn't want these uses to trigger warnings just because the user is checking out arbitrary revisions from the logs rather than using tags and branches. But, yes, as soon as the user actually _commits_ in the detached state, then a check for "HEAD == some branch" should be just fine for checking a checkout to somewhere else. -Carl
Attachment:
pgpzYBawaLpvm.pgp
Description: PGP signature