Re: git with custom diff for commits

3 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: git with custom diff for commits

From: Matthieu Moy <hidden>
Date: 2016-06-15 22:44:00

Johannes Schindelin [off-list ref] writes:
Hi,

On Mon, 17 Dec 2007, Gerald Gutierrez wrote:
quoted
I do a nightly mysqldump of a database and check it into a git 
repository. mysqldump generates a timestamp as part of that output which 
is causing git to think that the file changes every night when it really 
doesn't. The timestamp is simply in an SQL comment.

So what I'd like to do is teach git to ignore that particular SQL 
timestamp comment. I've tried to set up an external diff script that 
runs diff -I "<<sql timestamp comment>>" that effectively ignores the 
timestamp. While this works with "git diff", it seems when git commits, 
it still sees the differences.

How do I properly teach git to ignore these types of differences?
You might be interested in reading Documentation/gitattributes.txt, look 
for "diff driver".
It will show an empty output for "git diff", but I doubt thit will
change anything at commit time. Probably the "filter" thing on the
same file (also "man gitattributes") can help though.

-- 
Matthieu

Re: git with custom diff for commits

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:44:00

Hi,

On Tue, 18 Dec 2007, Matthieu Moy wrote:
Johannes Schindelin [off-list ref] writes:
quoted
On Mon, 17 Dec 2007, Gerald Gutierrez wrote:
quoted
I've tried to set up an external diff script that runs diff -I "<<sql 
timestamp comment>>" that effectively ignores the timestamp. While 
this works with "git diff", it seems when git commits, it still sees 
the differences.

How do I properly teach git to ignore these types of differences?
You might be interested in reading Documentation/gitattributes.txt, 
look for "diff driver".
It will show an empty output for "git diff", but I doubt thit will 
change anything at commit time. Probably the "filter" thing on the same 
file (also "man gitattributes") can help though.
Ah, right.  I completely missed that you were talking about git-commit, 
not git-log on git commits.

Yes, setting up a "clean" filter that removes the timestamps is probably 
the reasonable thing to do here.

Sorry for the noise,
Dscho

RE: git with custom diff for commits

From: Gerald Gutierrez <hidden>
Date: 2016-06-15 22:44:00

 
Ah, right.  I completely missed that you were talking about 
git-commit, not git-log on git commits.

Yes, setting up a "clean" filter that removes the timestamps 
is probably the reasonable thing to do here.
I read about the filter too, but have no idea how to implement it. Any
examples that I could follow?

Thanks,
Gerald.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help