summaryrefslogtreecommitdiff
path: root/builtin/log.c
diff options
context:
space:
mode:
authorSergey Organov <sorganov@gmail.com>2022-12-17 16:29:51 +0300
committerJunio C Hamano <gitster@pobox.com>2022-12-18 11:43:50 +0900
commit08f55ec7b20b888a668fabbad4147f67a209ded7 (patch)
treed0a51bb13460e4271ceafaf079d5a53a5dfdeae0 /builtin/log.c
parentc000d916380bb59db69c78546928eadd076b9c7d (diff)
downloadgit-08f55ec7b20b888a668fabbad4147f67a209ded7.tar.gz
diff-merges: implement [no-]hide option and log.diffMergesHide config
The set of diff-merges options happened to be incomplete, and failed to implement exact semantics of -m option that hides output of diffs for merge commits unless -p option is active as well. The new "hide" option fixes this issue, so that now --diff-merges=on --diff-merges=hide combo is the exact synonym for -m. The log.diffMerges configuration also accepts "hide" and "no-hide" values, and governs the default value for the hide bit. The configuration behaves as if "--diff-merges=[no-]hide" is inserted first in the command-line. New log.diffMergesHide boolean configuration is implemented as well, for the case when log.diffMerges is already in use for specifying the format. Signed-off-by: Sergey Organov <sorganov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/log.c')
-rw-r--r--builtin/log.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/log.c b/builtin/log.c
index 5eafcf26b4..46e45d4553 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -582,6 +582,8 @@ static int git_log_config(const char *var, const char *value, void *cb)
}
if (!strcmp(var, "log.diffmerges"))
return diff_merges_config(value);
+ if (!strcmp(var, "log.diffmergeshide"))
+ return diff_merges_hide_config(git_config_bool(var, value));
if (!strcmp(var, "log.showroot")) {
default_show_root = git_config_bool(var, value);
return 0;