From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Narebski Subject: Re: git refuses to switch to older branches Date: Sun, 20 Aug 2006 00:48:56 +0200 Organization: At home Message-ID: References: <20060819202558.GE30022@admingilde.org> <7v3bbs1h8c.fsf@assigned-by-dhcp.cox.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-From: git-owner@vger.kernel.org Sun Aug 20 00:49:18 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 1GEZcs-00060v-4w for gcvg-git@gmane.org; Sun, 20 Aug 2006 00:49:10 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751290AbWHSWtH (ORCPT ); Sat, 19 Aug 2006 18:49:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751581AbWHSWtG (ORCPT ); Sat, 19 Aug 2006 18:49:06 -0400 Received: from main.gmane.org ([80.91.229.2]:50665 "EHLO ciao.gmane.org") by vger.kernel.org with ESMTP id S1751290AbWHSWtF (ORCPT ); Sat, 19 Aug 2006 18:49:05 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1GEZcg-0005yT-K6 for git@vger.kernel.org; Sun, 20 Aug 2006 00:48:58 +0200 Received: from host-81-190-24-244.torun.mm.pl ([81.190.24.244]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 20 Aug 2006 00:48:58 +0200 Received: from jnareb by host-81-190-24-244.torun.mm.pl with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 20 Aug 2006 00:48:58 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: git@vger.kernel.org X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: host-81-190-24-244.torun.mm.pl Mail-Copies-To: jnareb@gmail.com User-Agent: KNode/0.10.2 Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: Junio C Hamano wrote: > 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. If I remember correctly that is what I did when "master" (and I had switch to master to do "git pull origin") didn't contain gitweb.cgi -> gitweb.perl rename. My proposed solution first overwrites generated gitweb.cgi by tracked file (i'm not sure if this is feature or bug that git-checkout with file specified (path limit specified?) doesn't need -f, and then you can do git-checkout full branch without -f. -- Jakub Narebski Warsaw, Poland ShadeHawk on #git