path: root/diff.c
diff options
authorJeff King <>2008-01-04 08:59:34 (GMT)
committerJunio C Hamano <>2008-01-05 00:05:23 (GMT)
commit9a1805a8726ee41f25be2e0f2d5f38f1150d38e4 (patch)
tree8c7689216c4a0814ee7d3e97213be71bff8a937a /diff.c
parent061d6b9a7bfcf88ff3895aa1be8424ae1647cbca (diff)
add a "basic" diff config callback
The diff porcelain uses git_diff_ui_config to set porcelain-ish config options, like automatically turning on color. The plumbing specifically avoids calling this function, since it doesn't want things like automatic color or rename detection. However, some diff options should be set for both plumbing and porcelain. For example, one can still turn on color in git-diff-files using the --color command line option. This means we want the color config from color.diff.* (so that once color is on, we use the user's preferred scheme), but _not_ the color.diff variable. We split the diff config into "ui" and "basic", where "basic" is suitable for use by plumbing (so _most_ things affecting the output should still go into the "ui" part). Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'diff.c')
1 files changed, 6 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index 5bdc111..44aa477 100644
--- a/diff.c
+++ b/diff.c
@@ -178,6 +178,12 @@ int git_diff_ui_config(const char *var, const char *value)
return parse_funcname_pattern(var, ep, value);
+ return git_diff_basic_config(var, value);
+int git_diff_basic_config(const char *var, const char *value)
if (!prefixcmp(var, "diff.color.") || !prefixcmp(var, "color.diff.")) {
int slot = parse_diff_color_slot(var, 11);
color_parse(value, var, diff_colors[slot]);