From 9579bf1bca1905c53d3faf723183a2d8d3328be4 Mon Sep 17 00:00:00 2001 From: Brandon Phillips Date: Tue, 6 Jan 2015 11:19:58 -0500 Subject: diff: teach diff.relative to give default to --relative= Setting diff.relative configuration variable to true makes 'git diff' behave as if '--relative=true' was passed on the command line. Signed-off-by: Brandon Phillips Signed-off-by: Junio C Hamano --- diff.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'diff.c') diff --git a/diff.c b/diff.c index 7bceba88d2..9e4ec1f8a7 100644 --- a/diff.c +++ b/diff.c @@ -223,6 +223,14 @@ int git_diff_ui_config(const char *var, const char *value, void *cb) return 0; } + if (!strcmp(var, "diff.relative")) { + if (git_config_bool(var, value)) + DIFF_OPT_SET(&default_diff_options, RELATIVE_NAME); + else + DIFF_OPT_CLR(&default_diff_options, RELATIVE_NAME); + return 0; + } + if (git_color_config(var, value, cb) < 0) return -1; -- cgit v1.2.1