From: Carl Worth Subject: Re: [PATCH] Detached HEAD (experimental) Date: Tue, 09 Jan 2007 16:51:51 -0800 Message-ID: <87vejfya8o.wl%cworth@cworth.org> References: <7vac11yirf.fsf@assigned-by-dhcp.cox.net> <87ps9xgkjo.wl%cworth@cworth.org> <7virfprquo.fsf@assigned-by-dhcp.cox.net> <87odphgfzz.wl%cworth@cworth.org> <7vbql9ydd7.fsf@assigned-by-dhcp.cox.net> <20070108131735.GA2647@coredump.intra.peff.net> <7vzm8tt5kf.fsf@assigned-by-dhcp.cox.net> <20070109142130.GA10633@coredump.intra.peff.net> <7virffkick.fsf@assigned-by-dhcp.cox.net> <20070109213117.GB25012@fieldses.org> <7vy7obj07k.fsf@assigned-by-dhcp.cox.net> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Tue_Jan__9_16:51:44_2007-1"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Cc: Junio C Hamano , "J. Bruce Fields" , Jeff King , git@vger.kernel.org X-From: git-owner@vger.kernel.org Wed Jan 10 01:54:00 2007 Return-path: Envelope-to: gcvg-git@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1H4Rj0-0007AN-Vc for gcvg-git@gmane.org; Wed, 10 Jan 2007 01:53:55 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932542AbXAJAxw (ORCPT ); Tue, 9 Jan 2007 19:53:52 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932593AbXAJAxw (ORCPT ); Tue, 9 Jan 2007 19:53:52 -0500 Received: from mx1.redhat.com ([66.187.233.31]:35883 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932542AbXAJAxv (ORCPT ); Tue, 9 Jan 2007 19:53:51 -0500 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id l0A0rie4021373; Tue, 9 Jan 2007 19:53:44 -0500 Received: from mail.boston.redhat.com (mail.boston.redhat.com [172.16.76.12]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l0A0riDi000797; Tue, 9 Jan 2007 19:53:44 -0500 Received: from raht.cworth.org (sebastian-int.corp.redhat.com [172.16.52.221]) by mail.boston.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id l0A0rhet016103; Tue, 9 Jan 2007 19:53:43 -0500 To: Linus Torvalds In-Reply-To: User-Agent: Wanderlust/2.14.0 (Africa) Emacs/21.4 Mule/5.0 (SAKAKI) Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: --pgp-sign-Multipart_Tue_Jan__9_16:51:44_2007-1 Content-Type: text/plain; charset=US-ASCII 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 --pgp-sign-Multipart_Tue_Jan__9_16:51:44_2007-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQBFpDin6JDdNq8qSWgRAhA1AKChz5vBgtGLiv6Ubv2N+ZmYJILSTQCgnUEB PVujhume/JEJZ1/cvI+hu0o= =wqeQ -----END PGP SIGNATURE----- --pgp-sign-Multipart_Tue_Jan__9_16:51:44_2007-1--