Thread (309 messages) flat view 309 messages, 17 authors, 2018-10-02
STALE2915d

Revision v6 of 2 in this series.

Revisions (2)
  1. v5 [diff vs current]
  2. v6 current

[PATCH v6 16/21] range-diff --dual-color: skip white-space warnings

From: Johannes Schindelin via GitGitGadget <hidden>
Date: 2018-08-13 11:33:28
Subsystem: the rest · Maintainer: Linus Torvalds

From: Johannes Schindelin <redacted>

When displaying a diff of diffs, it is possible that there is an outer
`+` before a context line. That happens when the context changed between
old and new commit. When that context line starts with a tab (after the
space that marks it as context line), our diff machinery spits out a
white-space error (space before tab), but in this case, that is
incorrect.

Rather than adding a specific whitespace flag that specifically ignores
the first space in the output (and might miss other problems with the
white-space warnings), let's just skip handling white-space errors in
dual color mode to begin with.

Signed-off-by: Johannes Schindelin <redacted>
---
 diff.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/diff.c b/diff.c
index e6c857abf..ea8ecae04 100644
--- a/diff.c
+++ b/diff.c
@@ -1299,6 +1299,7 @@ static void emit_diff_symbol_from_struct(struct diff_options *o,
 				set = diff_get_color_opt(o, DIFF_FRAGINFO);
 			else if (c != '+')
 				set = diff_get_color_opt(o, DIFF_CONTEXT);
+			flags &= ~DIFF_SYMBOL_CONTENT_WS_MASK;
 		}
 		emit_line_ws_markup(o, set, reset, line, len, set_sign, '+',
 				    flags & DIFF_SYMBOL_CONTENT_WS_MASK,
-- 
gitgitgadget
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help