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

[PATCH 2/2] --graph: respect --no-color

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 30, 2009, 15:49 UTC
Message-ID
<0d85995e0a6b497080e7b02d6468e14a210dbbae.1238428115u.git.johannes.schindelin@gmx.de>
In-Reply-To
<cover.1238428115u.git.johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 graph.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/graph.c b/graph.c
index 5e2f224..6a8622c 100644
--- a/graph.c
+++ b/graph.c
@@ -5,7 +5,6 @@
 #include "diff.h"
 #include "revision.h"
 
-extern int diff_use_color_default;
 /* Internal API */
 
 /*
@@ -1253,15 +1252,17 @@ static void strbuf_write_column(struct strbuf *sb, const struct column *c,
 	 * right flag to be checking since --no-color doesn't turn
 	 * this off.
 	 */
-	if (diff_use_color_default)
+	if (c->color)
 		strbuf_addstr(sb, c->color);
 	strbuf_addstr(sb, s);
-	if (diff_use_color_default)
+	if (c->color)
 		strbuf_addstr(sb, GIT_COLOR_RESET);
 }
 
 static char* get_current_column_color (const struct git_graph* graph)
 {
+	if (!DIFF_OPT_TST(&graph->revs->diffopt, COLOR_DIFF))
+		return NULL;
 	return column_colors[graph->default_column_color];
 }
 
-- 
1.6.2.1.493.g67cf3
Previous: Junio C Hamano
Message 24 of 24 in “[RFC] Colorization of log --graph”
  1. Allan CaffeeMar 18, 2009
  2. Johannes SchindelinMar 18, 2009
  3. Allan CaffeeMar 19, 2009
  4. Johannes SchindelinMar 19, 2009
  5. Nanako ShiraishiMar 19, 2009
  6. Allan CaffeeMar 20, 2009
  7. Jeff KingMar 20, 2009
  8. Junio C HamanoMar 20, 2009
  9. Eric RaibleMar 18, 2009
  10. Santi BéjarMar 18, 2009
  11. Eric RaibleMar 18, 2009
  12. Markus HeidelbergMar 19, 2009
  13. Eric RaibleMar 19, 2009
  14. Markus HeidelbergMar 19, 2009
  15. graph API: Added logic for colored edges.Allan Caffee, Mar 30, 2009
  16. Johannes SchindelinMar 30, 2009
  17. Johannes SchindelinMar 31, 2009
  18. Johannes SixtMar 31, 2009
  19. Johannes SchindelinMar 31, 2009
  20. Johannes SchindelinMar 31, 2009
  21. 1/2 graph.c: avoid compile warningsJohannes Schindelin, Mar 30, 2009
  22. Junio C HamanoMar 30, 2009
  23. Junio C HamanoMar 30, 2009
  24. 2/2 --graph: respect --no-colorJohannes Schindelin, Mar 30, 2009

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.