diff options
author | Brandon Phillips <kelson@shysecurity.com> | 2015-01-06 11:19:58 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-01-07 09:33:11 -0800 |
commit | 9579bf1bca1905c53d3faf723183a2d8d3328be4 (patch) | |
tree | 3ac93d496f3625a2881341e694bb4c14ac7e82b6 /diff.c | |
parent | b48d3f810cd0dc1c9805ea211b4a87ff9fcabdd0 (diff) | |
download | git-bp/diff-relative-config.tar.gz |
diff: teach diff.relative to give default to --relative=<value>bp/diff-relative-config
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 <kelson@shysecurity.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r-- | diff.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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; |