git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <junkio@cox.net>
Date
Jun 24, 2006, 11:23 UTC
Message-ID
<7vveqqx0f4.fsf_-_@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0606221301500.5498@g5.osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 Linus Torvalds <torvalds@osdl.org> 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
Previous: Johannes Schindelin
Message 18 of 18 in “What's in git.git and announcing v1.4.1-rc1”
  1. Junio C HamanoJun 22, 2006
  2. Junio C HamanoJun 22, 2006
  3. Paolo CiarrocchiJun 22, 2006
  4. Linus TorvaldsJun 22, 2006
  5. Petr BaudisJun 22, 2006
  6. Linus TorvaldsJun 22, 2006
  7. Jakub NarebskiJun 22, 2006
  8. Petr BaudisJun 22, 2006
  9. Johannes SchindelinJun 23, 2006
  10. Junio C HamanoJun 22, 2006
  11. Junio C HamanoJun 22, 2006
  12. Johannes SchindelinJun 23, 2006
  13. Pádraig BradyJun 23, 2006
  14. Johannes SchindelinJun 23, 2006
  15. Linus TorvaldsJun 23, 2006
  16. diff --color: use $GIT_DIR/configJunio C Hamano, Jun 24, 2006
  17. Johannes SchindelinJun 24, 2006
  18. diff --color: use reset sequence when we mean reset.Junio C Hamano, Jun 24, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.