Skip to content

Commit 74b15bf

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fdf96a2 commit 74b15bf

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Documentation/config.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,8 @@ command line with the `--color[=<when>]` option.
870870
color.diff.<slot>::
871871
Use customized color for diff colorization. `<slot>` specifies
872872
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`
874875
(hunk header), 'func' (function in hunk header), `old` (removed lines),
875876
`new` (added lines), `commit` (commit headers), or `whitespace`
876877
(highlighting whitespace errors). The values of these variables may be

diff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static char diff_colors[][COLOR_MAXLEN] = {
5454

5555
static int parse_diff_color_slot(const char *var)
5656
{
57-
if (!strcasecmp(var, "plain"))
57+
if (!strcasecmp(var, "context") || !strcasecmp(var, "plain"))
5858
return DIFF_PLAIN;
5959
if (!strcasecmp(var, "meta"))
6060
return DIFF_METAINFO;

0 commit comments

Comments
 (0)