git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/3] diff: flip the diff.bwoutputonly default to false

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 29, 2009, 07:25 UTC
Message-ID
<7veinhdc71.fsf_-_@alter.siamese.dyndns.org>
In-Reply-To
<7vmy25dc9h.fsf@alter.siamese.dyndns.org>

This finally corrects the broken "ignore whitespace options only affect patch output and never affects status nor header output", as we have been planning for 1.7.0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 diff.c                       |    2 +-
 t/t4015-diff-whitespace.sh   |    5 +++--
 t/t4040-whitespace-status.sh |    2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/diff.c b/diff.c
index fb93a22..df67f18 100644
--- a/diff.c
+++ b/diff.c
@@ -29,7 +29,7 @@ static const char *diff_word_regex_cfg;
 static const char *external_diff_cmd_cfg;
 int diff_auto_refresh_index = 1;
 static int diff_mnemonic_prefix;
-static int diff_b_w_output_only = 1;
+static int diff_b_w_output_only;
 static int diff_b_w_output_only_given;
 
 static char diff_colors[][COLOR_MAXLEN] = {
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index 310421b..8ca81e8 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -114,6 +114,7 @@ index d99af23..8b32fb5 100644
 EOF
 test_w_b "bwoutputonly=true"
 
+>expect
 git config --unset diff.bwoutputonly
 test_w_b "bwoutputonly unset"
 
@@ -398,7 +399,7 @@ test_expect_success 'checkdiff allows new blank lines' '
 	git diff --check
 '
 
-test_expect_success 'whitespace-only changes shown' '
+test_expect_success 'whitespace-only changes hidden' '
 	git config --unset diff.bwoutputonly
 	git reset --hard &&
 	echo >x "hello world" &&
@@ -406,7 +407,7 @@ test_expect_success 'whitespace-only changes shown' '
 	git commit -m "hello 1" &&
 	echo >x "hello  world" &&
 	git diff -b >actual &&
-	test 2 = $(wc -l <actual)
+	! test -s actual
 '
 
 test_expect_success 'whitespace-only changes shown with diff.bwoutputonly' '
diff --git a/t/t4040-whitespace-status.sh b/t/t4040-whitespace-status.sh
index 95a93f7..57db3cc 100755
--- a/t/t4040-whitespace-status.sh
+++ b/t/t4040-whitespace-status.sh
@@ -72,6 +72,6 @@ git config diff.bwoutputonly false
 test_once "bwoutputonly=false" ""
 
 git config --unset diff.bwoutputonly
-test_once "bwoutputonly unset" "test_must_fail"
+test_once "bwoutputonly unset" ""
 
 test_done
-- 
1.6.6.rc0.61.g41d5b.dirty
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 7 in “[RFH] Mention of 1.7.0 transition plans in Release Notes to 1.6.6”
  1. Junio C HamanoNov 28, 2009
  2. Nanako ShiraishiNov 29, 2009
  3. Junio C HamanoNov 29, 2009
  4. Junio C HamanoNov 29, 2009
  5. 1/3 diff: flip the default diff.bwoutputonly to trueJunio C Hamano, Nov 29, 2009
  6. 2/3 diff: flip the diff.bwoutputonly default to falseJunio C Hamano, Nov 29, 2009
  7. 3/3 diff: disable diff.bwoutputonly warningJunio C Hamano, Nov 29, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.