git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] add--interactive: allow diff colors without interactive colors
@ 2008-01-04  8:35 Jeff King
  2008-01-05  0:20 ` Junio C Hamano
  0 siblings, 1 reply; 17+ messages in thread
From: Jeff King @ 2008-01-04  8:35 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

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

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2008-01-08 12:53 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-04  8:35 [PATCH] add--interactive: allow diff colors without interactive colors Jeff King
2008-01-05  0:20 ` Junio C Hamano
2008-01-05  3:37   ` Jeff King
2008-01-05  8:01     ` Junio C Hamano
2008-01-05  8:51       ` Jeff King
2008-01-05  9:28         ` Junio C Hamano
2008-01-05  9:57           ` Jeff King
2008-01-05 10:58   ` [PATCH/resend] " Matthias Kestenholz
2008-01-05 11:11     ` Junio C Hamano
2008-01-05 14:10       ` Matthias Kestenholz
2008-01-05 14:11         ` [PATCH 1/4] Add infrastructure for a single color config variable Matthias Kestenholz
2008-01-05 14:11           ` [PATCH 2/4] git branch: Use color configuration infrastructure Matthias Kestenholz
2008-01-05 14:11             ` [PATCH 3/4] status and commit: " Matthias Kestenholz
2008-01-05 14:11               ` [PATCH 4/4] diff and log: " Matthias Kestenholz
2008-01-08 11:23             ` [PATCH 2/4] git branch: " Jeff King
2008-01-08 12:52               ` Matthias Kestenholz
2008-01-05 11:37     ` [PATCH/resend] add--interactive: allow diff colors without interactive colors Jakub Narebski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).