From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carl Worth Subject: Re: [PATCH] git-checkout: disable guides how to switch branches with ui.guide Date: Thu, 01 Feb 2007 13:34:10 -0800 Message-ID: <87ps8ta7fx.wl%cworth@cworth.org> References: <20070131231942.GB31145@coredump.intra.peff.net> <20070201030030.GA1979@coredump.intra.peff.net> <7vd54ur26u.fsf@assigned-by-dhcp.cox.net> <7vlkjip7mu.fsf_-_@assigned-by-dhcp.cox.net> <20070201184403.GA6326@moooo.ath.cx> <7vabzxpq2t.fsf@assigned-by-dhcp.cox.net> <20070201205145.GA13439@moooo.ath.cx> <7vabzxoaed.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_Thu_Feb__1_13:34:10_2007-1"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Cc: Matthias Lederhofer , git@vger.kernel.org To: Junio C Hamano X-From: git-owner@vger.kernel.org Thu Feb 01 22:34:18 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 1HCjZQ-000366-OL for gcvg-git@gmane.org; Thu, 01 Feb 2007 22:34:17 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422964AbXBAVeN (ORCPT ); Thu, 1 Feb 2007 16:34:13 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1423024AbXBAVeN (ORCPT ); Thu, 1 Feb 2007 16:34:13 -0500 Received: from cworth.org ([217.160.249.188]:58021 "EHLO theworths.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1422964AbXBAVeN (ORCPT ); Thu, 1 Feb 2007 16:34:13 -0500 Received: (qmail 12867 invoked from network); 1 Feb 2007 16:34:11 -0500 Received: from localhost (HELO raht.cworth.org) (127.0.0.1) by localhost with SMTP; 1 Feb 2007 16:34:11 -0500 In-Reply-To: <7vabzxoaed.fsf@assigned-by-dhcp.cox.net> 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_Thu_Feb__1_13:34:10_2007-1 Content-Type: text/plain; charset=US-ASCII On Thu, 01 Feb 2007 13:06:34 -0800, Junio C Hamano wrote: > The error message you quoted is given when your head is detached > and you tried the regular "checkout an existing branch" -- which > will lose where your detached HEAD currently is. I think the problem with this is that git tells the user so little information, ("may lose your changes"). What changes? Is that dirty state? Some commits? Hmm... have I committed anything? Why can't git be sure about what this operation is going to do? I think a really useful message would be something like: You are not on any branch so switching to branch 'foo' will cause the following commits to be lost: ba531642 A commit headline here... b1189118 Another commit headline here... Refusing to checkout 'foo'. Didn't a bunch of work get committed to make the reachability analysis feasible to generate a message like this? If there are no commits that would become dangling, then the checkout should just proceed. As for the concern about losing a pointer to some "valuable" state that will still technically be reachable, but might be hard to get back, why not just print a message along the lines of: Leaving commit 7b1509f4 to checkout 'foo'. (or just depend on the HEAD reflog). -Carl PS. If nothing else gets changed in the current message, please reconsider the current wording of: Leaving your HEAD detached; not switching to branch 'foo'. Think: Wow, I had heard that git might help me shoot myself in the foot, but I never though I might behead myself with it. It would probably work to just reword that as: Not switching to branch 'foo'. --pgp-sign-Multipart_Thu_Feb__1_13:34:10_2007-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQBFwlzS6JDdNq8qSWgRAp22AJ9AlSjRKSMyLOiCib9csvxY3a8pDwCdEayA K8m376adI68thSeQyRQkt2Q= =vlTc -----END PGP SIGNATURE----- --pgp-sign-Multipart_Thu_Feb__1_13:34:10_2007-1--