From: Carl Worth Subject: Re: [PATCH] Detached HEAD (experimental) Date: Tue, 09 Jan 2007 13:43:16 -0800 Message-ID: <87zm8ryiyz.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> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Tue_Jan__9_13:43:11_2007-1"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Cc: Junio C Hamano , Jeff King , git@vger.kernel.org X-From: git-owner@vger.kernel.org Tue Jan 09 22:45:31 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 1H4OmZ-0008A9-MS for gcvg-git@gmane.org; Tue, 09 Jan 2007 22:45:24 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932250AbXAIVpV (ORCPT ); Tue, 9 Jan 2007 16:45:21 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932371AbXAIVpU (ORCPT ); Tue, 9 Jan 2007 16:45:20 -0500 Received: from mx1.redhat.com ([66.187.233.31]:55287 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932250AbXAIVpT (ORCPT ); Tue, 9 Jan 2007 16:45:19 -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 l09LjFjn009704; Tue, 9 Jan 2007 16:45:15 -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 l09Lj96J023456; Tue, 9 Jan 2007 16:45:09 -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 l09Lj8aD025399; Tue, 9 Jan 2007 16:45:08 -0500 To: "J. Bruce Fields" In-Reply-To: <20070109213117.GB25012@fieldses.org> 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_13:43:11_2007-1 Content-Type: text/plain; charset=US-ASCII On Tue, 9 Jan 2007 16:31:17 -0500, "J. Bruce Fields" wrote: > > > git checkout v1.4.0 > > > hack hack hack > > > git commit -m -a 'some changes which will never be seen again' > > > git checkout v1.2.0 > > > > > > I thought the _point_ of the safety valve was not to lose those changes. ... > Stupid question: why can't checkout do something like this? > > if we're currently not on a branch, fail if .git/PREV > doesn't point to the same commit as .git/HEAD. > > if we're checking out a non-branch, store its SHA1 into > .git/PREV. I would guess the problem is that this would still cause warnings even if the user had since given a name (created a branch) for the commits originally made to the dangling head. Frankly, I don't understand why so much effort is being put toward allowing these "fragile commits" to be made in the first place. Why not require users to name the branch before creating any commits, just as has always been the case? To me, the only real advantage to the new "detached head" stuff is simply making it easier to checkout previous state without having to name a new branch precisely _because_ the user has not intent to commit anything. If the user is going to commit something, then the user should be able to come up with a name for the branch. But, whatever, if allowing fragile commits is seen as important by those doing the work, who am I to complain about that? I'd just ask that the following not be made slow: git checkout commit-from-beginning-of-time git checkout master Thanks to the index, and the simplicity of what "git checkout" means, checkout has always been blisteringly fast. All the talk of doing reachability analysis scares me from a performance point of view, (particularly when the _interesting_ cases (to me) of checkouts to non-branches never need this anyway---since no commits will be made). Thanks, -Carl --pgp-sign-Multipart_Tue_Jan__9_13:43:11_2007-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQBFpAx06JDdNq8qSWgRAnjdAJ9+BxuCJjQfqFH4S7Kf0N9qC3LIYgCfTYKv 1P5OahrHgwFre6T8yKNoCGY= =11Ub -----END PGP SIGNATURE----- --pgp-sign-Multipart_Tue_Jan__9_13:43:11_2007-1--