diff options
Diffstat (limited to 'builtin-log.c')
-rw-r--r-- | builtin-log.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/builtin-log.c b/builtin-log.c index 442cc87cc1..5d39565e94 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -765,10 +765,12 @@ static int subject_prefix_callback(const struct option *opt, const char *arg, return 0; } +static int numbered_cmdline_opt = 0; + static int numbered_callback(const struct option *opt, const char *arg, int unset) { - *(int *)opt->value = unset ? 0 : 1; + *(int *)opt->value = numbered_cmdline_opt = unset ? 0 : 1; if (unset) auto_number = 0; return 0; @@ -979,6 +981,15 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) if (start_number < 0) start_number = 1; + + /* + * If numbered is set solely due to format.numbered in config, + * and it would conflict with --keep-subject (-k) from the + * command line, reset "numbered". + */ + if (numbered && keep_subject && !numbered_cmdline_opt) + numbered = 0; + if (numbered && keep_subject) die ("-n and -k are mutually exclusive."); if (keep_subject && subject_prefix) |