From mboxrd@z Thu Jan 1 00:00:00 1970 From: Junio C Hamano Subject: Re: git refuses to switch to older branches Date: Sat, 19 Aug 2006 15:41:07 -0700 Message-ID: <7v3bbs1h8c.fsf@assigned-by-dhcp.cox.net> References: <20060819202558.GE30022@admingilde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: git@vger.kernel.org, Martin Waitz X-From: git-owner@vger.kernel.org Sun Aug 20 00:41:16 2006 Return-path: Envelope-to: gcvg-git@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GEZVE-0004h8-6S for gcvg-git@gmane.org; Sun, 20 Aug 2006 00:41:16 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751851AbWHSWlK (ORCPT ); Sat, 19 Aug 2006 18:41:10 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751579AbWHSWlK (ORCPT ); Sat, 19 Aug 2006 18:41:10 -0400 Received: from fed1rmmtao01.cox.net ([68.230.241.38]:53183 "EHLO fed1rmmtao01.cox.net") by vger.kernel.org with ESMTP id S1751290AbWHSWlJ (ORCPT ); Sat, 19 Aug 2006 18:41:09 -0400 Received: from assigned-by-dhcp.cox.net ([68.4.5.203]) by fed1rmmtao01.cox.net (InterMail vM.6.01.06.01 201-2131-130-101-20060113) with ESMTP id <20060819224108.BFI6077.fed1rmmtao01.cox.net@assigned-by-dhcp.cox.net>; Sat, 19 Aug 2006 18:41:08 -0400 To: Jakub Narebski User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: Jakub Narebski writes: > Martin Waitz wrote: > >> now that gitweb.cgi is autogenerated, git refuses to switch to old >> branches unless force is applied: >> >> fatal: Untracked working tree file 'gitweb/gitweb.cgi' would >> be overwritten by merge. >> >> This safety measure is quite useful normally, but for files that are >> explicitly marked as to-be-ignored it should not be neccessary. >> >> But all the code that handles .gitignore is only used by ls-files now. >> Does it make sense to add exclude handling to unpack-trees.c, too? > > I think it is "better to be annoying but safe" idea of git. You can always > do "git checkout gitweb/gitweb.cgi" and "git checkout ", > and not use -f. I think you are talking backwards. Newer branch have .cgi generated and older branch has it tracked. After you have built in a newer branch, checking out an older branch without -f option would play it safe not to clobber .cgi which is annoying. So workaround you would want to suggest is TO USE -f. > Or add gitweb.cgi to .gitignore in the old branch. And this "adding something to old one" is nonsense ;-).