diff.c: --ws-error-highlight=<kind> option

Traditionally, we only cared about whitespace breakages introduced
in new lines.  Some people want to paint whitespace breakages on old
lines, too.  When they see a whitespace breakage on a new line, they
can spot the same kind of whitespace breakage on the corresponding
old line and want to say "Ah, those breakages are there but they
were inherited from the original, so let's not touch them for now."

Introduce `--ws-error-highlight=<kind>` option, that lets them pass
a comma separated list of `old`, `new`, and `context` to specify
what lines to highlight whitespace errors on.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano
2015-05-26 10:11:28 -07:00
parent 0e383e185a
commit b8767f791c
4 changed files with 183 additions and 20 deletions

5
diff.h
View File

@ -137,6 +137,11 @@ struct diff_options {
int dirstat_permille;
int setup;
int abbrev;
/* white-space error highlighting */
#define WSEH_NEW 1
#define WSEH_CONTEXT 2
#define WSEH_OLD 4
unsigned ws_error_highlight;
const char *prefix;
int prefix_length;
const char *stat_sep;