git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Update "diff -w --exit-code"
@ 2009-05-23 19:24 Junio C Hamano
  2009-05-23 19:24 ` [PATCH 1/2] diff: change semantics of "ignore whitespace" options Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2009-05-23 19:24 UTC (permalink / raw)
  To: git

Here is a re-roll of the earlier patch to change the exit status of "diff"
family of commands on whitespace only changes.

Earlier, "-w" and friends only affected the displayed of textual diff
output and never caused the commands to ignore the presense of
differences.  With this, the commands exit with zero status when the
changes are only about whitespaces that you are ignoring.

E.g. starting from a clean slate:

	$ echo ' a' >a-file ;# one space
	$ git add a-file
	$ echo '  a' >a-file ;# two spaces
	$ git diff --exit-code -w >/dev/null; echo $?

will give 0, instead of 1.

The fact that you have changes (i.e. the contents of a-file as a whole has
changed) is still reported in the textual part of the output by showing
the "diff --git a/a-file b/b-file" header and the "index objname..objname mode"
line.  This is not likely to change.

Junio C Hamano (2):
  diff: change semantics of "ignore whitespace" options
  diff: Rename QUIET internal option to QUICK

 builtin-log.c                |    2 +-
 builtin-rev-list.c           |    2 +-
 diff-lib.c                   |    4 +-
 diff.c                       |   39 ++++++++++++++++++++++---
 diff.h                       |    3 +-
 revision.c                   |    2 +-
 t/t4037-whitespace-status.sh |   63 ++++++++++++++++++++++++++++++++++++++++++
 tree-diff.c                  |    3 +-
 8 files changed, 106 insertions(+), 12 deletions(-)
 create mode 100755 t/t4037-whitespace-status.sh

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

end of thread, other threads:[~2009-05-25 18:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-23 19:24 [PATCH 0/2] Update "diff -w --exit-code" Junio C Hamano
2009-05-23 19:24 ` [PATCH 1/2] diff: change semantics of "ignore whitespace" options Junio C Hamano
2009-05-23 19:24   ` [PATCH 2/2] diff: Rename QUIET internal option to QUICK Junio C Hamano
2009-05-25 11:04   ` [PATCH 1/2] diff: change semantics of "ignore whitespace" options Jeff King
2009-05-25 18:48     ` 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).