diff options
author | 2012-10-25 06:41:57 -0400 | |
---|---|---|
committer | 2012-10-25 06:41:57 -0400 | |
commit | 8de8f9f656696a3c04e5f0a274b57e4a719a66ce (patch) | |
tree | 181e8f9626ed245aab923a60294085ffd368cc55 /diff.c | |
parent | Merge branch 'jk/no-more-pre-exec-callback' (diff) | |
parent | t4055: avoid use of sed 'a' command (diff) | |
download | tgif-8de8f9f656696a3c04e5f0a274b57e4a719a66ce.tar.xz |
Merge branch 'jm/diff-context-config'
Teaches a new configuration variable to "git diff" Porcelain and
its friends.
* jm/diff-context-config:
t4055: avoid use of sed 'a' command
diff: diff.context configuration gives default to -U
Diffstat (limited to 'diff.c')
-rw-r--r-- | diff.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -26,6 +26,7 @@ static int diff_detect_rename_default; static int diff_rename_limit_default = 400; static int diff_suppress_blank_empty; static int diff_use_color_default = -1; +static int diff_context_default = 3; static const char *diff_word_regex_cfg; static const char *external_diff_cmd_cfg; int diff_auto_refresh_index = 1; @@ -141,6 +142,12 @@ int git_diff_ui_config(const char *var, const char *value, void *cb) diff_use_color_default = git_config_colorbool(var, value); return 0; } + if (!strcmp(var, "diff.context")) { + diff_context_default = git_config_int(var, value); + if (diff_context_default < 0) + return -1; + return 0; + } if (!strcmp(var, "diff.renames")) { diff_detect_rename_default = git_config_rename(var, value); return 0; @@ -3170,7 +3177,7 @@ void diff_setup(struct diff_options *options) options->break_opt = -1; options->rename_limit = -1; options->dirstat_permille = diff_dirstat_permille_default; - options->context = 3; + options->context = diff_context_default; DIFF_OPT_SET(options, RENAME_EMPTY); options->change = diff_change; |