summaryrefslogtreecommitdiff
path: root/color.c
diff options
context:
space:
mode:
authorMatthias Kestenholz <mk@spinlock.ch>2008-02-18 08:26:03 +0100
committerJunio C Hamano <gitster@pobox.com>2008-02-18 00:00:38 -0800
commit6b2f2d9805dd22c6f74957e0d76a1d2921b40c16 (patch)
tree04abc994611f31c778738577db1e83bd9a979835 /color.c
parentcf5c51efc9fe3b0ef93c7b78005c57b71acaf959 (diff)
downloadgit-6b2f2d9805dd22c6f74957e0d76a1d2921b40c16.tar.gz
Add color.ui variable which globally enables colorization if set
Signed-off-by: Matthias Kestenholz <mk@spinlock.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'color.c')
-rw-r--r--color.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/color.c b/color.c
index cb70340420..12a6453f90 100644
--- a/color.c
+++ b/color.c
@@ -3,6 +3,8 @@
#define COLOR_RESET "\033[m"
+int git_use_color_default = 0;
+
static int parse_color(const char *name, int len)
{
static const char * const color_names[] = {
@@ -143,6 +145,16 @@ int git_config_colorbool(const char *var, const char *value, int stdout_is_tty)
return 0;
}
+int git_color_default_config(const char *var, const char *value)
+{
+ if (!strcmp(var, "color.ui")) {
+ git_use_color_default = git_config_colorbool(var, value, -1);
+ return 0;
+ }
+
+ return git_default_config(var, value);
+}
+
static int color_vfprintf(FILE *fp, const char *color, const char *fmt,
va_list args, const char *trail)
{