summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c9bfb95)
raw | patch | inline | side by side (parent: c9bfb95)
author | Pang Yan Han <pangyanhan@gmail.com> | |
Mon, 12 Sep 2011 17:46:41 +0000 (01:46 +0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 12 Sep 2011 18:43:58 +0000 (11:43 -0700) |
commit c9bfb953 (want_color: automatically fallback to color.ui,
2011-08-17) introduced a regression where format-patch produces colorized
patches when color.ui is set to "always".
In f3aafa4 (Disable color detection during format-patch, 2006-07-09),
git_format_config was taught to intercept diff.color to avoid passing it
down to git_log_config and later, git_diff_ui_config.
Teach git_format_config to intercept color.ui in the same way.
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-08-17) introduced a regression where format-patch produces colorized
patches when color.ui is set to "always".
In f3aafa4 (Disable color detection during format-patch, 2006-07-09),
git_format_config was taught to intercept diff.color to avoid passing it
down to git_log_config and later, git_diff_ui_config.
Teach git_format_config to intercept color.ui in the same way.
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/log.c | patch | blob | history | |
t/t4014-format-patch.sh | patch | blob | history |
diff --git a/builtin/log.c b/builtin/log.c
index d760ee0885763e964afd9cdaf09a0986da606804..f5d49305903911eb7aa0fb3f73e0fd950b896228 100644 (file)
--- a/builtin/log.c
+++ b/builtin/log.c
string_list_append(&extra_cc, value);
return 0;
}
- if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff")) {
+ if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff") ||
+ !strcmp(var, "color.ui")) {
return 0;
}
if (!strcmp(var, "format.numbered")) {
index 92248d24c48a65ab89a5b0ad255357f6034e6ad4..15bd4a648a43fc92bdf872055fa2f3d40647681c 100755 (executable)
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
test_cmp expect actual
'
+test_expect_success 'format patch ignores color.ui' '
+ test_unconfig color.ui &&
+ git format-patch --stdout -1 >expect &&
+ test_config color.ui always &&
+ git format-patch --stdout -1 >actual &&
+ test_cmp expect actual
+'
+
test_done