From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Pitre Subject: Re: master^ is not a local branch -- huh?!? Date: Sat, 30 Jan 2010 00:05:45 -0500 (EST) Message-ID: References: <7vaavwh6yh.fsf@alter.siamese.dyndns.org> <7vy6jgcutb.fsf@alter.siamese.dyndns.org> <7viqakcu56.fsf@alter.siamese.dyndns.org> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Content-Transfer-Encoding: 7BIT Cc: Junio C Hamano , Sverre Rabbelier , Git List , Ron1 , Jacob Helwig To: Mark Lodato X-From: git-owner@vger.kernel.org Sat Jan 30 06:06:25 2010 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Nb5XN-0000Ax-0B for gcvg-git-2@lo.gmane.org; Sat, 30 Jan 2010 06:06:25 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750929Ab0A3FFr (ORCPT ); Sat, 30 Jan 2010 00:05:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750906Ab0A3FFr (ORCPT ); Sat, 30 Jan 2010 00:05:47 -0500 Received: from relais.videotron.ca ([24.201.245.36]:55215 "EHLO relais.videotron.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750879Ab0A3FFq (ORCPT ); Sat, 30 Jan 2010 00:05:46 -0500 Received: from xanadu.home ([66.130.28.92]) by VL-MO-MR004.ip.videotron.ca (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTP id <0KX100DQJNHLXJF0@VL-MO-MR004.ip.videotron.ca> for git@vger.kernel.org; Sat, 30 Jan 2010 00:05:46 -0500 (EST) X-X-Sender: nico@xanadu.home In-reply-to: User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Fri, 29 Jan 2010, Nicolas Pitre wrote: > On Fri, 29 Jan 2010, Mark Lodato wrote: > > > This discussion brings up another good point: The main worry about a > > detached head is losing commits. Back in 2008, it was suggested to > > have a warning when committing on a detached HEAD: > > > > http://kerneltrap.org/mailarchive/git/2008/9/2/3169744 > > > > This was before the advice system, so folks complained about it > > getting in the way, and it was never implemented. Since we now have a > > way to easily turn off the warning, perhaps we should bring this topic > > up again (probably as a separate thread.) > > Possibly. I don't like the message proposed in that patch though. > Since the warning when actually detaching HEAD is about to become way > more prominent, the per-commit warning doesn't have to be that noisy > anymore. Thinking more about it, I still consider that making 'git commit' more noisy is the wrong approach. Again, the problem is not about making commits on a detached HEAD. but rather about losing those commits at the next 'git checkout'. Probably a warning should be made when that checkout is attempted after one or more commits were made on a detached HEAD instead, and refuse the checkout by default unless it is forced (-f is already taken for some other force meaning). The warning should say how not to lose those commits by suggesting a branch creation, or give the hint for performing the checkout anyway. Nicolas