summaryrefslogtreecommitdiff
path: root/color.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-10-13 13:24:31 -0400
committerJunio C Hamano <gitster@pobox.com>2017-10-17 15:09:52 +0900
commit33c643bb083133376f3fdcb190ebc58f9eef12bb (patch)
treeecab5c8142f092e7fe32150dde7b2122601e7b4f /color.c
parent1d4b12fe7c44da166070a4b577c62fb83127f10e (diff)
downloadgit-33c643bb083133376f3fdcb190ebc58f9eef12bb.tar.gz
Revert "color: check color.ui in git_default_config()"
This reverts commit 136c8c8b8fa39f1315713248473dececf20f8fe7. That commit was trying to address a bug caused by 4c7f1819b3 (make color.ui default to 'auto', 2013-06-10), in which plumbing like diff-tree defaulted to "auto" color, but did not respect a "color.ui" directive to disable it. But it also meant that we started respecting "color.ui" set to "always". This was a known problem, but 4c7f1819b3 argued that nobody ought to be doing that. However, that turned out to be wrong, and we got a number of bug reports related to "add -p" regressing in v2.14.2. Let's revert 136c8c8b8, fixing the regression to "add -p". This leaves the problem from 4c7f1819b3 unfixed, but: 1. It's a pretty obscure problem in the first place. I only noticed it while working on the color code, and we haven't got a single bug report or complaint about it. 2. We can make a more moderate fix on top by respecting "never" but not "always" for plumbing commands. This is just the minimal fix to go back to the working state we had before v2.14.2. Note that this isn't a pure revert. We now have a test in t3701 which shows off the "add -p" regression. This can be flipped to success. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'color.c')
-rw-r--r--color.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/color.c b/color.c
index 7aa8b076f0..31b6207a00 100644
--- a/color.c
+++ b/color.c
@@ -361,6 +361,14 @@ int git_color_config(const char *var, const char *value, void *cb)
return 0;
}
+int git_color_default_config(const char *var, const char *value, void *cb)
+{
+ if (git_color_config(var, value, cb) < 0)
+ return -1;
+
+ return git_default_config(var, value, cb);
+}
+
void color_print_strbuf(FILE *fp, const char *color, const struct strbuf *sb)
{
if (*color)