[PATCH 0/2] Update "diff -w --exit-code"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]