Skip to content

Commit

Permalink
diff: accept color.diff.context as a synonym for "plain"
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff King authored and Junio C Hamano committed May 27, 2015
1 parent fdf96a2 commit 74b15bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Documentation/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,8 @@ command line with the `--color[=<when>]` option.
color.diff.<slot>::
Use customized color for diff colorization. `<slot>` specifies
which part of the patch to use the specified color, and is one
of `plain` (context text), `meta` (metainformation), `frag`
of `context` (context text - `plain` is a historical synonym),
`meta` (metainformation), `frag`
(hunk header), 'func' (function in hunk header), `old` (removed lines),
`new` (added lines), `commit` (commit headers), or `whitespace`
(highlighting whitespace errors). The values of these variables may be
Expand Down
2 changes: 1 addition & 1 deletion diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static char diff_colors[][COLOR_MAXLEN] = {

static int parse_diff_color_slot(const char *var)
{
if (!strcasecmp(var, "plain"))
if (!strcasecmp(var, "context") || !strcasecmp(var, "plain"))
return DIFF_PLAIN;
if (!strcasecmp(var, "meta"))
return DIFF_METAINFO;
Expand Down

0 comments on commit 74b15bf

Please sign in to comment.