diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-09-08 21:49:47 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-09-08 21:49:47 -0700 |
commit | 452a9073ba9f1fb157b3e5710b718aaf802e7631 (patch) | |
tree | 80cd21be4042097a0d2ed5a3bc7e96f6e0f22fd5 /builtin/log.c | |
parent | c4071eace94a7dca1cc0c0702fc0d4f23d2fc510 (diff) | |
parent | 957ed3a56c50f5c542e0cac58d75e1d4b9658ac3 (diff) | |
download | git-452a9073ba9f1fb157b3e5710b718aaf802e7631.tar.gz |
Merge branch 'jk/format-patch-number-singleton-patch-with-cover'
"git format-patch --cover-letter HEAD^" to format a single patch
with a separate cover letter now numbers the output as [PATCH 0/1]
and [PATCH 1/1] by default.
* jk/format-patch-number-singleton-patch-with-cover:
format-patch: show 0/1 and 1/1 for singleton patch with cover letter
Diffstat (limited to 'builtin/log.c')
-rw-r--r-- | builtin/log.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/log.c b/builtin/log.c index 92dc34dcb0..49aa534f4a 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -1676,16 +1676,16 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) /* nothing to do */ return 0; total = nr; - if (!keep_subject && auto_number && total > 1) - numbered = 1; - if (numbered) - rev.total = total + start_number - 1; if (cover_letter == -1) { if (config_cover_letter == COVER_AUTO) cover_letter = (total > 1); else cover_letter = (config_cover_letter == COVER_ON); } + if (!keep_subject && auto_number && (total > 1 || cover_letter)) + numbered = 1; + if (numbered) + rev.total = total + start_number - 1; if (!signature) { ; /* --no-signature inhibits all signatures */ |