aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-04-19 21:09:54 -0700
committerJunio C Hamano <gitster@pobox.com>2008-04-19 21:09:54 -0700
commitdc46fa36b8dc407512fa41062caf57082a22907a (patch)
treeb64f0fd82bae3638348af34627e396cb545a12bc
parent8876046037a3064f906d2155ea30cb6db186e409 (diff)
parent4d4f5ba3ea9d22137f86f1d8e574a667e76e45bf (diff)
downloadgit-dc46fa36b8dc407512fa41062caf57082a22907a.tar.gz
git-dc46fa36b8dc407512fa41062caf57082a22907a.tar.xz
Merge branch 'mk/color'
* mk/color: Use color.ui variable in scripts too
-rw-r--r--Documentation/git-config.txt2
-rw-r--r--builtin-config.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
index fa161718d..5de5d051b 100644
--- a/Documentation/git-config.txt
+++ b/Documentation/git-config.txt
@@ -144,6 +144,8 @@ See also <<FILES>>.
"auto". If `stdout-is-tty` is missing, then checks the standard
output of the command itself, and exits with status 0 if color
is to be used, or exits with status 1 otherwise.
+ When the color setting for `name` is undefined, the command uses
+ `color.ui` as fallback.
--get-color name default::
diff --git a/builtin-config.c b/builtin-config.c
index 10447a704..8ee01bdec 100644
--- a/builtin-config.c
+++ b/builtin-config.c
@@ -240,6 +240,10 @@ static int git_get_colorbool_config(const char *var, const char *value)
get_diff_color_found =
git_config_colorbool(var, value, stdout_is_tty);
}
+ if (!strcmp(var, "color.ui")) {
+ git_use_color_default = git_config_colorbool(var, value, stdout_is_tty);
+ return 0;
+ }
return 0;
}
@@ -267,7 +271,7 @@ static int get_colorbool(int argc, const char **argv)
if (!strcmp(get_color_slot, "color.diff"))
get_colorbool_found = get_diff_color_found;
if (get_colorbool_found < 0)
- get_colorbool_found = 0;
+ get_colorbool_found = git_use_color_default;
}
if (argc == 1) {