New log.diffMerges configuration variable sets the format that --diff-merges=def will be using. The default is "separate". Signed-off-by: Sergey Organov <sorganov@xxxxxxxxx> --- builtin/log.c | 2 ++ diff-merges.c | 11 +++++++++++ diff-merges.h | 2 ++ 3 files changed, 15 insertions(+) diff --git a/builtin/log.c b/builtin/log.c index 8acd285dafd8..6102893fccb9 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -481,6 +481,8 @@ static int git_log_config(const char *var, const char *value, void *cb) decoration_style = 0; /* maybe warn? */ return 0; } + if (!strcmp(var, "log.diffmerges")) + return diff_merges_config(value); if (!strcmp(var, "log.showroot")) { default_show_root = git_config_bool(var, value); return 0; diff --git a/diff-merges.c b/diff-merges.c index 93ede09fb36f..ca4d94a9039d 100644 --- a/diff-merges.c +++ b/diff-merges.c @@ -90,6 +90,17 @@ static void set_diff_merges(struct rev_info *revs, const char *optarg) * Public functions. They are in the order they are called. */ +int diff_merges_config(const char *value) +{ + diff_merges_setup_func_t func = func_by_opt(value); + + if (!func) + return -1; + + set_to_default = func; + return 0; +} + int diff_merges_parse_opts(struct rev_info *revs, const char **argv) { int argcount = 1; diff --git a/diff-merges.h b/diff-merges.h index 659467c99a4f..09d9a6c9a4fb 100644 --- a/diff-merges.h +++ b/diff-merges.h @@ -9,6 +9,8 @@ struct rev_info; +int diff_merges_config(const char *value); + int diff_merges_parse_opts(struct rev_info *revs, const char **argv); void diff_merges_suppress(struct rev_info *revs); -- 2.25.1