@@ -42,7 +42,7 @@ static long diff_algorithm;
42
42
43
43
static char diff_colors [][COLOR_MAXLEN ] = {
44
44
GIT_COLOR_RESET ,
45
- GIT_COLOR_NORMAL , /* PLAIN */
45
+ GIT_COLOR_NORMAL , /* CONTEXT */
46
46
GIT_COLOR_BOLD , /* METAINFO */
47
47
GIT_COLOR_CYAN , /* FRAGINFO */
48
48
GIT_COLOR_RED , /* OLD */
@@ -54,8 +54,8 @@ static char diff_colors[][COLOR_MAXLEN] = {
54
54
55
55
static int parse_diff_color_slot (const char * var )
56
56
{
57
- if (!strcasecmp (var , "plain" ))
58
- return DIFF_PLAIN ;
57
+ if (!strcasecmp (var , "context" ) || ! strcasecmp ( var , " plain" ))
58
+ return DIFF_CONTEXT ;
59
59
if (!strcasecmp (var , "meta" ))
60
60
return DIFF_METAINFO ;
61
61
if (!strcasecmp (var , "frag" ))
@@ -528,13 +528,13 @@ static void emit_context_line(const char *reset,
528
528
const char * line , int len )
529
529
{
530
530
emit_line_checked (reset , ecbdata , line , len ,
531
- DIFF_PLAIN , WSEH_CONTEXT , ' ' );
531
+ DIFF_CONTEXT , WSEH_CONTEXT , ' ' );
532
532
}
533
533
534
534
static void emit_hunk_header (struct emit_callback * ecbdata ,
535
535
const char * line , int len )
536
536
{
537
- const char * plain = diff_get_color (ecbdata -> color_diff , DIFF_PLAIN );
537
+ const char * context = diff_get_color (ecbdata -> color_diff , DIFF_CONTEXT );
538
538
const char * frag = diff_get_color (ecbdata -> color_diff , DIFF_FRAGINFO );
539
539
const char * func = diff_get_color (ecbdata -> color_diff , DIFF_FUNCINFO );
540
540
const char * reset = diff_get_color (ecbdata -> color_diff , DIFF_RESET );
@@ -551,7 +551,7 @@ static void emit_hunk_header(struct emit_callback *ecbdata,
551
551
if (len < 10 ||
552
552
memcmp (line , atat , 2 ) ||
553
553
!(ep = memmem (line + 2 , len - 2 , atat , 2 ))) {
554
- emit_line (ecbdata -> opt , plain , reset , line , len );
554
+ emit_line (ecbdata -> opt , context , reset , line , len );
555
555
return ;
556
556
}
557
557
ep += 2 ; /* skip over @@ */
@@ -573,7 +573,7 @@ static void emit_hunk_header(struct emit_callback *ecbdata,
573
573
if (* ep != ' ' && * ep != '\t' )
574
574
break ;
575
575
if (ep != cp ) {
576
- strbuf_addstr (& msgbuf , plain );
576
+ strbuf_addstr (& msgbuf , context );
577
577
strbuf_add (& msgbuf , cp , ep - cp );
578
578
strbuf_addstr (& msgbuf , reset );
579
579
}
@@ -654,10 +654,10 @@ static void emit_rewrite_lines(struct emit_callback *ecb,
654
654
data += len ;
655
655
}
656
656
if (!endp ) {
657
- const char * plain = diff_get_color (ecb -> color_diff ,
658
- DIFF_PLAIN );
657
+ const char * context = diff_get_color (ecb -> color_diff ,
658
+ DIFF_CONTEXT );
659
659
putc ('\n' , ecb -> opt -> file );
660
- emit_line_0 (ecb -> opt , plain , reset , '\\' ,
660
+ emit_line_0 (ecb -> opt , context , reset , '\\' ,
661
661
nneof , strlen (nneof ));
662
662
}
663
663
}
@@ -1117,7 +1117,7 @@ static void init_diff_words_data(struct emit_callback *ecbdata,
1117
1117
struct diff_words_style * st = ecbdata -> diff_words -> style ;
1118
1118
st -> old .color = diff_get_color_opt (o , DIFF_FILE_OLD );
1119
1119
st -> new .color = diff_get_color_opt (o , DIFF_FILE_NEW );
1120
- st -> ctx .color = diff_get_color_opt (o , DIFF_PLAIN );
1120
+ st -> ctx .color = diff_get_color_opt (o , DIFF_CONTEXT );
1121
1121
}
1122
1122
}
1123
1123
@@ -1193,7 +1193,7 @@ static void fn_out_consume(void *priv, char *line, unsigned long len)
1193
1193
{
1194
1194
struct emit_callback * ecbdata = priv ;
1195
1195
const char * meta = diff_get_color (ecbdata -> color_diff , DIFF_METAINFO );
1196
- const char * plain = diff_get_color (ecbdata -> color_diff , DIFF_PLAIN );
1196
+ const char * context = diff_get_color (ecbdata -> color_diff , DIFF_CONTEXT );
1197
1197
const char * reset = diff_get_color (ecbdata -> color_diff , DIFF_RESET );
1198
1198
struct diff_options * o = ecbdata -> opt ;
1199
1199
const char * line_prefix = diff_line_prefix (o );
@@ -1264,7 +1264,7 @@ static void fn_out_consume(void *priv, char *line, unsigned long len)
1264
1264
}
1265
1265
diff_words_flush (ecbdata );
1266
1266
if (ecbdata -> diff_words -> type == DIFF_WORDS_PORCELAIN ) {
1267
- emit_line (ecbdata -> opt , plain , reset , line , len );
1267
+ emit_line (ecbdata -> opt , context , reset , line , len );
1268
1268
fputs ("~\n" , ecbdata -> opt -> file );
1269
1269
} else {
1270
1270
/*
@@ -1276,7 +1276,7 @@ static void fn_out_consume(void *priv, char *line, unsigned long len)
1276
1276
line ++ ;
1277
1277
len -- ;
1278
1278
}
1279
- emit_line (ecbdata -> opt , plain , reset , line , len );
1279
+ emit_line (ecbdata -> opt , context , reset , line , len );
1280
1280
}
1281
1281
return ;
1282
1282
}
@@ -1299,7 +1299,7 @@ static void fn_out_consume(void *priv, char *line, unsigned long len)
1299
1299
/* incomplete line at the end */
1300
1300
ecbdata -> lno_in_preimage ++ ;
1301
1301
emit_line (ecbdata -> opt ,
1302
- diff_get_color (ecbdata -> color_diff , DIFF_PLAIN ),
1302
+ diff_get_color (ecbdata -> color_diff , DIFF_CONTEXT ),
1303
1303
reset , line , len );
1304
1304
break ;
1305
1305
}
0 commit comments