From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Packham Subject: Re: getting git to ignore modifications to specific files Date: Thu, 02 Sep 2010 12:40:04 -0700 Message-ID: <4C7FFD94.90901@gmail.com> References: <4C7EA1FF.8030307@gmail.com> <4C7F7A57.4030504@drmicha.warpmail.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "git@vger.kernel.org" To: Michael J Gruber X-From: git-owner@vger.kernel.org Thu Sep 02 21:40:15 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 1OrFdt-0004wT-Gj for gcvg-git-2@lo.gmane.org; Thu, 02 Sep 2010 21:40:13 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755413Ab0IBTkG (ORCPT ); Thu, 2 Sep 2010 15:40:06 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:36225 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753126Ab0IBTkF (ORCPT ); Thu, 2 Sep 2010 15:40:05 -0400 Received: by pzk9 with SMTP id 9so285233pzk.19 for ; Thu, 02 Sep 2010 12:40:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=UkBTzztm+wlzrKSO/XqFByyr7slwjAqSSyvWkXwIPyg=; b=Bmz5+Y+864sxBNT3SOniMFNWzaYxocITxFJ58RnDuKonFejobGLaqf0SRgZGlFGGFD uCYjwLlFw43qGc5usLYUt/Q7cJ+6DixTJlQwx1u9eRcLjiOe5kZDPwdN3yKACuKkzqtz 7VVgYCNIkxoTPsWp2uk+L+qvqVn5X2aKO1Vt4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=kGTKX9RQAIXdyrm5n6wdduxdtXDWrDtEyYvakucPkkUwvFxs1de3cEcqPUqz/16/OR sepVeOWItvxJXsWuMeVDr9CzBfGvhx/rlDqEmgbLzd3S7yhpKtm0JPYhrwGISWq3mOPm zpBsBcCHe1FfMQsw8fl9YvXNfKCTd1rSdS6SU= Received: by 10.114.92.3 with SMTP id p3mr225041wab.77.1283456399903; Thu, 02 Sep 2010 12:39:59 -0700 (PDT) Received: from laptop.site (209-234-175-66.static.twtelecom.net [209.234.175.66]) by mx.google.com with ESMTPS id x9sm1639549waj.15.2010.09.02.12.39.58 (version=SSLv3 cipher=RC4-MD5); Thu, 02 Sep 2010 12:39:58 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.1.11) Gecko/20100714 SUSE/3.0.6 Thunderbird/3.0.6 In-Reply-To: <4C7F7A57.4030504@drmicha.warpmail.net> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On 02/09/10 03:20, Michael J Gruber wrote: > Chris Packham venit, vidit, dixit 01.09.2010 20:57: >> Hi, >> >> We have a git repository that as some GNU build system (a.k.a. >> autotools) files, my current problem is with the INSTALL file but I >> suspect there may be some others. These can get modified if you are >> running a different version of autotools from when the files were created. >> >> I've had various arguments about which autotools files should or >> shouldn't be included in our repositories. My general rule of thumb is >> that if it is automatically generated then it shouldn't go into the >> repository. >> >> There are a couple of repositories that are local clones of 3rd party >> repositories which have included the pesky auto-generated files so whle >> I can remove the offending files from repositories we control I need >> another solution for the 3rd part ones. >> >> I did a bit of googling and found >> git update-index --assume-unchanged >> >> Which works locally to stop git status from complaining. Is there anyway >> for me to make a change to our clone (a .gitattribues entry?) so that >> everyone can get this by default? > > For tracking my git configuration including .gitk, I used > > [filter "dotgitk"] > clean = fgrep -v geometry > > together with an appropriate attribute for gitk. > > I don't know how your autogenerated files differ, but maybe you can set > up a filter (or custom diff driver) which makes git think the files are > equal though they are not, just like in my case (ignoring window > geometry changes for gitk). > > Michael In my case the file differs quite a lot (GNU copyright statement has been updated) so a simple clean filter like that won't work. One question is if I could come up with a filter, would it even work to stop git status from saying its modified? I tried the custom diff [diff "ignoretracked"] command = true but that didn't stop git status from saying it was modified. It did however make "git diff" show no differences as expected. The best advice seems to be get the file removed. I've sent a patch upstream so hopefully that will fix the problem going forward.