summaryrefslogtreecommitdiff
path: root/builtin-log.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-log.c')
-rw-r--r--builtin-log.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/builtin-log.c b/builtin-log.c
index 442cc87cc1..c8c6208275 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -620,7 +620,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
struct shortlog log;
struct strbuf sb = STRBUF_INIT;
int i;
- const char *encoding = "utf-8";
+ const char *encoding = "UTF-8";
struct diff_options opts;
int need_8bit_cte = 0;
struct commit *commit = NULL;
@@ -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)