git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* "git diff --ignore-space-change --stat" lists files with only whitespace differences as "changed"
@ 2017-01-18  2:01 Matt McCutchen
  2017-01-18 11:17 ` Jeff King
  0 siblings, 1 reply; 5+ messages in thread
From: Matt McCutchen @ 2017-01-18  2:01 UTC (permalink / raw)
  To: git

A bug report: I noticed that "git diff --ignore-space-change --stat"
lists files with only whitespace differences as having changed with 0
differing lines.  This is inconsistent with the behavior without --
stat, which doesn't list such files at all.  (Same behavior with all
the --ignore*space* flags.)  I can reproduce this with the current
"next", af746e4.  Quick test case:

echo ' ' >test1 && echo '  ' >test2 &&
git diff --stat --no-index --ignore-space-change test1 test2

This caused me some inconvenience in the following scenario: I was
reading a commit diff that had a bulk license change in all files
combined with code changes.  I attempted to revert the bulk license
change locally using "sed" to more easily read the code diff, but my
reversion left some whitespace diffs where the original files had
inconsistent whitespace.  So the diffstat after my reversion was
cluttered with these "0" entries.

Regards,
Matt

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-01-18 23:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-18  2:01 "git diff --ignore-space-change --stat" lists files with only whitespace differences as "changed" Matt McCutchen
2017-01-18 11:17 ` Jeff King
2017-01-18 20:57   ` Junio C Hamano
2017-01-18 21:08     ` Jeff King
2017-01-18 22:15       ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).