Git development
 help / color / mirror / Atom feed
From: "Dirk Süsserott" <newsletter@dirk.my1.cc>
To: "Björn Steinbrink" <B.Steinbrink@gmx.de>
Cc: Git Mailing List <git@vger.kernel.org>, git@drmicha.warpmail.net
Subject: Re: How to make git diff-* ignore some patterns?
Date: Sun, 22 Nov 2009 16:51:49 +0100	[thread overview]
Message-ID: <4B095E15.9040209@dirk.my1.cc> (raw)
In-Reply-To: <20091121180738.GA14919@atjola.homenet>

Am 21.11.2009 19:07 schrieb Björn Steinbrink:
> On 2009.11.21 17:40:14 +0100, Dirk Süsserott wrote:
>> is there a way to tell "git diff-index" to ignore some special
>> patterns, such that /^-- Dump completed on .*$/ is NOT recognized as
>> a difference and "git diff-index" returns 0 if that's the only
>> difference?
> 
> If you don't mind losing that line, you could use a clean filter via
> .gitattributes:
> 
> echo '*.sql filter=mysql_dump' >> .gitattributes
> git config filter.mysql_dump.clean "sed -e '/^-- Dump completed on .*$/d'"
> 
> That way, git will filter all *.sql paths through that sed command
> before storing them as blobs, dropping that "Dump completed" line from
> the data stored in the repo.
> 
> Björn
> 

Thank you Björn and Michael,

Your suggestions were really helpful. I decided to use Björn's 'clean
filter' approach. It works great.

-- Dirk

      reply	other threads:[~2009-11-22 15:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-21 16:40 How to make git diff-* ignore some patterns? Dirk Süsserott
2009-11-21 17:31 ` Michael J Gruber
2009-11-21 18:07 ` Björn Steinbrink
2009-11-22 15:51   ` Dirk Süsserott [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=4B095E15.9040209@dirk.my1.cc \
    --to=newsletter@dirk.my1.cc \
    --cc=B.Steinbrink@gmx.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox