Thread (1 message) 1 message, 1 author, 2016-06-15
DORMANTno replies

[PATCH] diff --color: use reset sequence when we mean reset.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:31
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Junio C Hamano <redacted>
---

 Linus Torvalds [off-list ref] writes:

 >  - always reset the color _before_ printing out the newline.
 >
 >    This is actually important. You (and Johannes) didn't see it, because 
 >    it only matters if you set the background, but if you don't do this, 
 >    you get some random and funky behaviour if you pick a color with a 
 >    non-default background (which still potentially has problems with tabs 
 >    etc, but less so).

 Doh.

 I think you did not see it until you tried "git diff" with
 a stat-dirty but otherwise unmodified file.

 diff.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/diff.c b/diff.c
index 33c8c57..549f4e0 100644
--- a/diff.c
+++ b/diff.c
@@ -681,7 +681,7 @@ static void builtin_diff(const char *nam
 	const char *lbl[2];
 	char *a_one, *b_two;
 	const char *set = get_color(o->color_diff, DIFF_METAINFO);
-	const char *reset = get_color(o->color_diff, DIFF_PLAIN);
+	const char *reset = get_color(o->color_diff, DIFF_RESET);
 
 	a_one = quote_two("a/", name_a);
 	b_two = quote_two("b/", name_b);
-- 
1.4.1.rc1.ga77b7
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help