From 50bebf98d96a6ccf2ca5c76da5dd8afff6933a4c Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 17 Feb 2023 15:33:37 -0800 Subject: format.attach: allow empty value to disable multi-part messages When a lower precedence configuration file (e.g. /etc/gitconfig) defines format.attach in any way, there was no way to disable it in a more specific configuration file (e.g. $HOME/.gitconfig). Change the behaviour of setting it to an empty string. It used to mean that the result is still a multipart message with only dashes used as a multi-part separator, but now it resets the setting to the default (which would be to give an inline patch, unless other command line options are in effect). Signed-off-by: Junio C Hamano --- builtin/log.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'builtin/log.c') diff --git a/builtin/log.c b/builtin/log.c index 04412dd9c9..a70fba198f 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -1007,6 +1007,8 @@ static int git_format_config(const char *var, const char *value, void *cb) if (!strcmp(var, "format.attach")) { if (value && *value) default_attach = xstrdup(value); + else if (value && !*value) + FREE_AND_NULL(default_attach); else default_attach = xstrdup(git_version_string); return 0; -- cgit v1.2.1