git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to make git diff-* ignore some patterns?

From
Björn Steinbrink <b.steinbrink@gmx.de>
Date
Nov 21, 2009, 18:07 UTC
Message-ID
<20091121180738.GA14919@atjola.homenet>
In-Reply-To
<4B0817EE.1040000@dirk.my1.cc>
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
Previous: Michael J GruberNext: Dirk Süsserott
Message 3 of 4 in “How to make git diff-* ignore some patterns?”
  1. Dirk SüsserottNov 21, 2009
  2. Michael J GruberNov 21, 2009
  3. Björn SteinbrinkNov 21, 2009
  4. Dirk SüsserottNov 22, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.