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

[PATCH] add--interactive: allow diff colors without interactive colors

From
Jeff King <peff@peff.net>
Date
Jan 4, 2008, 08:35 UTC
Message-ID
<20080104083521.GB3354@coredump.intra.peff.net>

Users with color.diff set to true/auto will not see color in "git add -i" unless they also set color.interactive.

However, some users may want just one without the other, so there's no reason to tie them together.

Note that there is now no way to have color on for "git diff" but not for diffs from "git add -i"; such a configuration seems unlikely, though.

Signed-off-by: Jeff King <peff@peff.net>
---
 git-add--interactive.perl |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index 0cdd800..aaa9b24 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -22,16 +22,16 @@ if ($use_color) {
 	$header_color = $repo->get_color("color.interactive.header", "bold");
 	$help_color = $repo->get_color("color.interactive.help", "red bold");
 	$normal_color = $repo->get_color("", "reset");
+}
 
-	# Do we also set diff colors?
-	$diff_use_color = $repo->get_colorbool('color.diff');
-	if ($diff_use_color) {
-		$new_color = $repo->get_color("color.diff.new", "green");
-		$old_color = $repo->get_color("color.diff.old", "red");
-		$fraginfo_color = $repo->get_color("color.diff.frag", "cyan");
-		$metainfo_color = $repo->get_color("color.diff.meta", "bold");
-		$whitespace_color = $repo->get_color("color.diff.whitespace", "normal red");
-	}
+# Do we also set diff colors?
+$diff_use_color = $repo->get_colorbool('color.diff');
+if ($diff_use_color) {
+	$new_color = $repo->get_color("color.diff.new", "green");
+	$old_color = $repo->get_color("color.diff.old", "red");
+	$fraginfo_color = $repo->get_color("color.diff.frag", "cyan");
+	$metainfo_color = $repo->get_color("color.diff.meta", "bold");
+	$whitespace_color = $repo->get_color("color.diff.whitespace", "normal red");
 }
 
 sub colored {
-- 
1.5.4.rc2.1122.g6954-dirty
Next: Junio C Hamano
Message 1 of 17 in “add--interactive: allow diff colors without interactive colors”
  1. add--interactive: allow diff colors without interactive colorsJeff King, Jan 4, 2008
  2. Junio C HamanoJan 5, 2008
  3. Jeff KingJan 5, 2008
  4. Junio C HamanoJan 5, 2008
  5. Jeff KingJan 5, 2008
  6. Junio C HamanoJan 5, 2008
  7. Jeff KingJan 5, 2008
  8. Matthias KestenholzJan 5, 2008
  9. Junio C HamanoJan 5, 2008
  10. Matthias KestenholzJan 5, 2008
  11. 1/4 Add infrastructure for a single color config variableMatthias Kestenholz, Jan 5, 2008
  12. 2/4 git branch: Use color configuration infrastructureMatthias Kestenholz, Jan 5, 2008
  13. 3/4 status and commit: Use color configuration infrastructureMatthias Kestenholz, Jan 5, 2008
  14. 4/4 diff and log: Use color configuration infrastructureMatthias Kestenholz, Jan 5, 2008
  15. Jeff KingJan 8, 2008
  16. Matthias KestenholzJan 8, 2008
  17. Jakub NarebskiJan 5, 2008

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.