diff: accept color.diff.context as a synonym for "plain"
The term "plain" is a bit ambiguous; let's allow the more specific "context", but keep "plain" around for compatibility. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
May 27, 2015 at 03:22 UTC
74b15bfbf6f7efffa40fda170b3a3cb0218d8651
2 files changed
+3
-2
Documentation/config.txt
+2
-1
@@ -870,7 +870,8 @@ command line with the `--color[=<when>]` option.
870
color.diff.<slot>::
871
Use customized color for diff colorization. `<slot>` specifies
872
which part of the patch to use the specified color, and is one
873
- of `plain` (context text), `meta` (metainformation), `frag`
873
+ of `context` (context text - `plain` is a historical synonym),
874
+ `meta` (metainformation), `frag`
875
(hunk header), 'func' (function in hunk header), `old` (removed lines),
876
`new` (added lines), `commit` (commit headers), or `whitespace`
877
(highlighting whitespace errors). The values of these variables may be
diff.c
+1
-1
@@ -54,7 +54,7 @@ static char diff_colors[][COLOR_MAXLEN] = {
54
55
static int parse_diff_color_slot(const char *var)
56
{
57
- if (!strcasecmp(var, "plain"))
57
+ if (!strcasecmp(var, "context") || !strcasecmp(var, "plain"))
58
return DIFF_PLAIN;
59
if (!strcasecmp(var, "meta"))
60
return DIFF_METAINFO;