[PATCH 2/3] Use shorter error messages for whitespace problems

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

 



The initial version of the whitespace_error_string() function took the
messages from builtin-apply.c rather than the shorter messages from
diff.c.

This commit addresses Junio's concern that these messages might be too
long (now that we can emit multiple warnings per line).

Signed-off-by: Wincent Colaiuta <win@xxxxxxxxxxx>
---
 t/t4015-diff-whitespace.sh |    2 +-
 ws.c                       |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index 05ef78b..9bff8f5 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -121,7 +121,7 @@ test_expect_success 'check mixed spaces and tabs in indent' '
 
 	# This is indented with SP HT SP.
 	echo " 	 foo();" > x &&
-	git diff --check | grep "Space in indent is followed by a tab"
+	git diff --check | grep "space before tab in indent"
 
 '
 
diff --git a/ws.c b/ws.c
index d7d1522..46cbdd6 100644
--- a/ws.c
+++ b/ws.c
@@ -101,16 +101,16 @@ char *whitespace_error_string(unsigned ws)
 	struct strbuf err;
 	strbuf_init(&err, 0);
 	if (ws & WS_TRAILING_SPACE)
-		strbuf_addstr(&err, "Adds trailing whitespace");
+		strbuf_addstr(&err, "trailing whitespace");
 	if (ws & WS_SPACE_BEFORE_TAB) {
 		if (err.len)
 			strbuf_addstr(&err, ", ");
-		strbuf_addstr(&err, "Space in indent is followed by a tab");
+		strbuf_addstr(&err, "space before tab in indent");
 	}
 	if (ws & WS_INDENT_WITH_NON_TAB) {
 		if (err.len)
 			strbuf_addstr(&err, ", ");
-		strbuf_addstr(&err, "Indent more than 8 places with spaces");
+		strbuf_addstr(&err, "indent with spaces");
 	}
 	return strbuf_detach(&err, NULL);
 }
-- 
1.5.4.rc0.1099.g76fa0-dirty

-
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]

  Powered by Linux