All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Packham <judge.packham@gmail.com>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: getting git to ignore modifications to specific files
Date: Thu, 02 Sep 2010 12:40:04 -0700	[thread overview]
Message-ID: <4C7FFD94.90901@gmail.com> (raw)
In-Reply-To: <4C7F7A57.4030504@drmicha.warpmail.net>

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.

      reply	other threads:[~2010-09-02 19:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-01 18:57 getting git to ignore modifications to specific files Chris Packham
2010-09-01 19:06 ` Joshua Jensen
2010-09-01 19:12 ` Bruce Korb
2010-09-01 20:45   ` Chris Packham
2010-09-01 19:24 ` Joshua Juran
2010-09-02  4:09 ` Jonathan Nieder
2010-09-02  9:25 ` Jan Krüger
2010-09-02 10:20 ` Michael J Gruber
2010-09-02 19:40   ` Chris Packham [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C7FFD94.90901@gmail.com \
    --to=judge.packham@gmail.com \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.