From 25a751f198c7f82e04f7c8ba866b3b89198c534f Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 21 Dec 2012 21:16:51 -0800 Subject: builtin/log.c: drop unused "numbered" parameter from make_cover_letter() Signed-off-by: Junio C Hamano --- builtin/log.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/log.c b/builtin/log.c index 09cf43e6d4..28d9063007 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -768,7 +768,7 @@ static void add_branch_description(struct strbuf *buf, const char *branch_name) } static void make_cover_letter(struct rev_info *rev, int use_stdout, - int numbered, int numbered_files, + int numbered_files, struct commit *origin, int nr, struct commit **list, struct commit *head, const char *branch_name, @@ -1343,7 +1343,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) if (cover_letter) { if (thread) gen_message_id(&rev, "cover"); - make_cover_letter(&rev, use_stdout, numbered, numbered_files, + make_cover_letter(&rev, use_stdout, numbered_files, origin, nr, list, head, branch_name, quiet); total++; start_number--; -- cgit v1.2.1 From ce37596c137aef257b9b75dce1c6b2fd498bab23 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 21 Dec 2012 21:27:38 -0800 Subject: builtin/log.c: drop redundant "numbered_files" parameter from make_cover_letter() Signed-off-by: Junio C Hamano --- builtin/log.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/builtin/log.c b/builtin/log.c index 28d9063007..f1d086e68b 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -768,7 +768,6 @@ static void add_branch_description(struct strbuf *buf, const char *branch_name) } static void make_cover_letter(struct rev_info *rev, int use_stdout, - int numbered_files, struct commit *origin, int nr, struct commit **list, struct commit *head, const char *branch_name, @@ -791,7 +790,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout, committer = git_committer_info(0); if (!use_stdout && - reopen_stdout(NULL, numbered_files ? NULL : "cover-letter", rev, quiet)) + reopen_stdout(NULL, rev->numbered_files ? NULL : "cover-letter", rev, quiet)) return; log_write_email_headers(rev, head, &pp.subject, &pp.after_subject, @@ -1045,7 +1044,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) int nr = 0, total, i; int use_stdout = 0; int start_number = -1; - int numbered_files = 0; /* _just_ numbers */ + int just_numbers = 0; int ignore_if_in_upstream = 0; int cover_letter = 0; int boundary_count = 0; @@ -1070,7 +1069,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) N_("print patches to standard out")), OPT_BOOLEAN(0, "cover-letter", &cover_letter, N_("generate a cover letter")), - OPT_BOOLEAN(0, "numbered-files", &numbered_files, + OPT_BOOLEAN(0, "numbered-files", &just_numbers, N_("use simple number sequence for output file names")), OPT_STRING(0, "suffix", &fmt_patch_suffix, N_("sfx"), N_("use instead of '.patch'")), @@ -1338,12 +1337,12 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) const char *msgid = clean_message_id(in_reply_to); string_list_append(rev.ref_message_ids, msgid); } - rev.numbered_files = numbered_files; + rev.numbered_files = just_numbers; rev.patch_suffix = fmt_patch_suffix; if (cover_letter) { if (thread) gen_message_id(&rev, "cover"); - make_cover_letter(&rev, use_stdout, numbered_files, + make_cover_letter(&rev, use_stdout, origin, nr, list, head, branch_name, quiet); total++; start_number--; @@ -1390,7 +1389,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) } if (!use_stdout && - reopen_stdout(numbered_files ? NULL : commit, NULL, &rev, quiet)) + reopen_stdout(rev.numbered_files ? NULL : commit, NULL, &rev, quiet)) die(_("Failed to create output files")); shown = log_tree_commit(&rev, commit); free(commit->buffer); -- cgit v1.2.1 From 68cb7b6f85aa032c33e49137364da9b76b1d95a1 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 21 Dec 2012 22:24:03 -0800 Subject: builtin/log.c: stop using global patch_suffix The suffix for the output filename is found in rev->patch_suffix; do not keep using the global that is only used to parse the command line and configuration. Signed-off-by: Junio C Hamano --- builtin/log.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/log.c b/builtin/log.c index f1d086e68b..7cf157e3ea 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -673,7 +673,7 @@ static int reopen_stdout(struct commit *commit, const char *subject, struct rev_info *rev, int quiet) { struct strbuf filename = STRBUF_INIT; - int suffix_len = strlen(fmt_patch_suffix) + 1; + int suffix_len = strlen(rev->patch_suffix) + 1; if (output_directory) { strbuf_addstr(&filename, output_directory); @@ -684,7 +684,7 @@ static int reopen_stdout(struct commit *commit, const char *subject, strbuf_addch(&filename, '/'); } - get_patch_filename(commit, subject, rev->nr, fmt_patch_suffix, &filename); + get_patch_filename(commit, subject, rev->nr, rev->patch_suffix, &filename); if (!quiet) fprintf(realstdout, "%s\n", filename.buf + outdir_offset); -- cgit v1.2.1 From 021f2f4c1aed011c664844408325fe683a4046a8 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 21 Dec 2012 23:26:16 -0800 Subject: get_patch_filename(): simplify function signature Most functions that emit to a strbuf take the strbuf as their first parameter; make this function follow suit. The serial number of the patch being emitted (nr) and suffix used for patch filename (suffix) are both recorded in rev_info; drop these separate parameters and pass the rev_info directly. Signed-off-by: Junio C Hamano --- builtin/log.c | 2 +- log-tree.c | 12 ++++++++---- log-tree.h | 5 +++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/builtin/log.c b/builtin/log.c index 7cf157e3ea..d9946ecd2f 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -684,7 +684,7 @@ static int reopen_stdout(struct commit *commit, const char *subject, strbuf_addch(&filename, '/'); } - get_patch_filename(commit, subject, rev->nr, rev->patch_suffix, &filename); + get_patch_filename(&filename, commit, subject, rev); if (!quiet) fprintf(realstdout, "%s\n", filename.buf + outdir_offset); diff --git a/log-tree.c b/log-tree.c index c894930c18..ceed6b62e6 100644 --- a/log-tree.c +++ b/log-tree.c @@ -299,9 +299,12 @@ static unsigned int digits_in_number(unsigned int number) return result; } -void get_patch_filename(struct commit *commit, const char *subject, int nr, - const char *suffix, struct strbuf *buf) +void get_patch_filename(struct strbuf *buf, + struct commit *commit, const char *subject, + struct rev_info *info) { + const char *suffix = info->patch_suffix; + int nr = info->nr; int suffix_len = strlen(suffix) + 1; int start_len = buf->len; @@ -387,8 +390,9 @@ void log_write_email_headers(struct rev_info *opt, struct commit *commit, mime_boundary_leader, opt->mime_boundary); extra_headers = subject_buffer; - get_patch_filename(opt->numbered_files ? NULL : commit, NULL, - opt->nr, opt->patch_suffix, &filename); + get_patch_filename(&filename, + opt->numbered_files ? NULL : commit, NULL, + opt); snprintf(buffer, sizeof(buffer) - 1, "\n--%s%s\n" "Content-Type: text/x-patch;" diff --git a/log-tree.h b/log-tree.h index f5ac238bba..c6a944a838 100644 --- a/log-tree.h +++ b/log-tree.h @@ -21,7 +21,8 @@ void log_write_email_headers(struct rev_info *opt, struct commit *commit, void load_ref_decorations(int flags); #define FORMAT_PATCH_NAME_MAX 64 -void get_patch_filename(struct commit *commit, const char *subject, int nr, - const char *suffix, struct strbuf *buf); +void get_patch_filename(struct strbuf *buf, + struct commit *commit, const char *subject, + struct rev_info *); #endif -- cgit v1.2.1 From 38ec23ac893e96a9027c1cf8112b3d97a0384d39 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 21 Dec 2012 21:39:37 -0800 Subject: get_patch_filename(): drop "just-numbers" hack The function chooses from three operating modes (format using the subject, the commit, or just number) based on NULL-ness of two of its parameters, which is an ugly hack for sharing only a bit of code. Separate out the "just numbers" part out to the callers. Signed-off-by: Junio C Hamano --- builtin/log.c | 5 ++++- log-tree.c | 29 ++++++++++++++--------------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/builtin/log.c b/builtin/log.c index d9946ecd2f..3c6f20a235 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -684,7 +684,10 @@ static int reopen_stdout(struct commit *commit, const char *subject, strbuf_addch(&filename, '/'); } - get_patch_filename(&filename, commit, subject, rev); + if (rev->numbered_files) + strbuf_addf(&filename, "%d", rev->nr); + else + get_patch_filename(&filename, commit, subject, rev); if (!quiet) fprintf(realstdout, "%s\n", filename.buf + outdir_offset); diff --git a/log-tree.c b/log-tree.c index ceed6b62e6..d9f86ce624 100644 --- a/log-tree.c +++ b/log-tree.c @@ -307,21 +307,18 @@ void get_patch_filename(struct strbuf *buf, int nr = info->nr; int suffix_len = strlen(suffix) + 1; int start_len = buf->len; + int max_len = start_len + FORMAT_PATCH_NAME_MAX - suffix_len; - strbuf_addf(buf, commit || subject ? "%04d-" : "%d", nr); - if (commit || subject) { - int max_len = start_len + FORMAT_PATCH_NAME_MAX - suffix_len; + strbuf_addf(buf, "%04d-", nr); + if (subject) + strbuf_addstr(buf, subject); + else if (commit) { struct pretty_print_context ctx = {0}; - - if (subject) - strbuf_addstr(buf, subject); - else if (commit) - format_commit_message(commit, "%f", buf, &ctx); - - if (max_len < buf->len) - strbuf_setlen(buf, max_len); - strbuf_addstr(buf, suffix); + format_commit_message(commit, "%f", buf, &ctx); } + if (max_len < buf->len) + strbuf_setlen(buf, max_len); + strbuf_addstr(buf, suffix); } void log_write_email_headers(struct rev_info *opt, struct commit *commit, @@ -390,9 +387,11 @@ void log_write_email_headers(struct rev_info *opt, struct commit *commit, mime_boundary_leader, opt->mime_boundary); extra_headers = subject_buffer; - get_patch_filename(&filename, - opt->numbered_files ? NULL : commit, NULL, - opt); + if (opt->numbered_files) + strbuf_addf(&filename, "%d", opt->nr); + else + get_patch_filename(&filename, commit, NULL, + opt); snprintf(buffer, sizeof(buffer) - 1, "\n--%s%s\n" "Content-Type: text/x-patch;" -- cgit v1.2.1 From d28b5d47ab72a91d5090748f8f8baaf6ffa084fc Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 21 Dec 2012 22:06:01 -0800 Subject: get_patch_filename(): split into two functions The function switched between two operating modes depending on the NULL-ness of its two parameters, as a hacky way to share small part of implementation, sacrificing cleanliness of the API. Implement "fmt_output_subject()" function that takes a subject string and gives the name for the output file, and on top of it, implement "fmt_output_commit()" function that takes a commit and gives the name for the output file. Signed-off-by: Junio C Hamano --- builtin/log.c | 4 +++- log-tree.c | 41 +++++++++++++++++++++++------------------ log-tree.h | 5 ++--- 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/builtin/log.c b/builtin/log.c index 3c6f20a235..8cfb4da662 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -686,8 +686,10 @@ static int reopen_stdout(struct commit *commit, const char *subject, if (rev->numbered_files) strbuf_addf(&filename, "%d", rev->nr); + else if (commit) + fmt_output_commit(&filename, commit, rev); else - get_patch_filename(&filename, commit, subject, rev); + fmt_output_subject(&filename, subject, rev); if (!quiet) fprintf(realstdout, "%s\n", filename.buf + outdir_offset); diff --git a/log-tree.c b/log-tree.c index d9f86ce624..670beaebf9 100644 --- a/log-tree.c +++ b/log-tree.c @@ -299,26 +299,32 @@ static unsigned int digits_in_number(unsigned int number) return result; } -void get_patch_filename(struct strbuf *buf, - struct commit *commit, const char *subject, +void fmt_output_subject(struct strbuf *filename, + const char *subject, struct rev_info *info) { const char *suffix = info->patch_suffix; int nr = info->nr; - int suffix_len = strlen(suffix) + 1; - int start_len = buf->len; - int max_len = start_len + FORMAT_PATCH_NAME_MAX - suffix_len; - - strbuf_addf(buf, "%04d-", nr); - if (subject) - strbuf_addstr(buf, subject); - else if (commit) { - struct pretty_print_context ctx = {0}; - format_commit_message(commit, "%f", buf, &ctx); - } - if (max_len < buf->len) - strbuf_setlen(buf, max_len); - strbuf_addstr(buf, suffix); + int start_len = filename->len; + int max_len = start_len + FORMAT_PATCH_NAME_MAX - (strlen(suffix) + 1); + + strbuf_addf(filename, "%04d-%s", nr, subject); + + if (max_len < filename->len) + strbuf_setlen(filename, max_len); + strbuf_addstr(filename, suffix); +} + +void fmt_output_commit(struct strbuf *filename, + struct commit *commit, + struct rev_info *info) +{ + struct pretty_print_context ctx = {0}; + struct strbuf subject = STRBUF_INIT; + + format_commit_message(commit, "%f", &subject, &ctx); + fmt_output_subject(filename, subject.buf, info); + strbuf_release(&subject); } void log_write_email_headers(struct rev_info *opt, struct commit *commit, @@ -390,8 +396,7 @@ void log_write_email_headers(struct rev_info *opt, struct commit *commit, if (opt->numbered_files) strbuf_addf(&filename, "%d", opt->nr); else - get_patch_filename(&filename, commit, NULL, - opt); + fmt_output_commit(&filename, commit, opt); snprintf(buffer, sizeof(buffer) - 1, "\n--%s%s\n" "Content-Type: text/x-patch;" diff --git a/log-tree.h b/log-tree.h index c6a944a838..9140f48216 100644 --- a/log-tree.h +++ b/log-tree.h @@ -21,8 +21,7 @@ void log_write_email_headers(struct rev_info *opt, struct commit *commit, void load_ref_decorations(int flags); #define FORMAT_PATCH_NAME_MAX 64 -void get_patch_filename(struct strbuf *buf, - struct commit *commit, const char *subject, - struct rev_info *); +void fmt_output_commit(struct strbuf *, struct commit *, struct rev_info *); +void fmt_output_subject(struct strbuf *, const char *subject, struct rev_info *); #endif -- cgit v1.2.1 From 5fe10fe80a04a57affbaa35258f498bc1acb05e9 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 22 Dec 2012 00:21:23 -0800 Subject: format-patch: add --reroll-count=$N option The --reroll-count=$N option, when given a positive integer: - Adds " v$N" to the subject prefix specified. As the default subject prefix string is "PATCH", --reroll-count=2 makes it "PATCH v2". - Prefixes "v$N-" to the names used for output files. The cover letter, whose name is usually 0000-cover-letter.patch, becomes v2-0000-cover-letter.patch when given --reroll-count=2. This allows users to use the same --output-directory for multiple iterations of the same series, without letting the output for a newer round overwrite output files from the earlier rounds. The user can incorporate materials from earlier rounds to update the newly minted iteration, and use "send-email v2-*.patch" to send out the patches belonging to the second iteration easily. Signed-off-by: Junio C Hamano --- builtin/log.c | 11 +++++++++++ log-tree.c | 2 ++ revision.h | 1 + 3 files changed, 14 insertions(+) diff --git a/builtin/log.c b/builtin/log.c index 8cfb4da662..e101498faa 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -1061,6 +1061,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) struct strbuf buf = STRBUF_INIT; int use_patch_format = 0; int quiet = 0; + int reroll_count = -1; char *branch_name = NULL; const struct option builtin_format_patch_options[] = { { OPTION_CALLBACK, 'n', "numbered", &numbered, NULL, @@ -1080,6 +1081,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) N_("use instead of '.patch'")), OPT_INTEGER(0, "start-number", &start_number, N_("start numbering patches at instead of 1")), + OPT_INTEGER(0, "reroll-count", &reroll_count, + N_("mark the series as Nth re-roll")), { OPTION_CALLBACK, 0, "subject-prefix", &rev, N_("prefix"), N_("Use [] instead of [PATCH]"), PARSE_OPT_NONEG, subject_prefix_callback }, @@ -1152,6 +1155,14 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN | PARSE_OPT_KEEP_DASHDASH); + if (0 < reroll_count) { + struct strbuf sprefix = STRBUF_INIT; + strbuf_addf(&sprefix, "%s v%d", + rev.subject_prefix, reroll_count); + rev.reroll_count = reroll_count; + rev.subject_prefix = strbuf_detach(&sprefix, NULL); + } + if (do_signoff) { const char *committer; const char *endpos; diff --git a/log-tree.c b/log-tree.c index 670beaebf9..5dc126b65c 100644 --- a/log-tree.c +++ b/log-tree.c @@ -308,6 +308,8 @@ void fmt_output_subject(struct strbuf *filename, int start_len = filename->len; int max_len = start_len + FORMAT_PATCH_NAME_MAX - (strlen(suffix) + 1); + if (0 < info->reroll_count) + strbuf_addf(filename, "v%d-", info->reroll_count); strbuf_addf(filename, "%04d-%s", nr, subject); if (max_len < filename->len) diff --git a/revision.h b/revision.h index a95bd0b3f3..e4a912ae6b 100644 --- a/revision.h +++ b/revision.h @@ -134,6 +134,7 @@ struct rev_info { const char *mime_boundary; const char *patch_suffix; int numbered_files; + int reroll_count; char *message_id; struct string_list *ref_message_ids; const char *add_signoff; -- cgit v1.2.1 From 4aad08e061df699b49e24c4d34698d734473fb66 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 2 Jan 2013 14:16:07 -0800 Subject: format-patch: document and test --reroll-count Signed-off-by: Junio C Hamano --- Documentation/git-format-patch.txt | 10 +++++++++- t/t4014-format-patch.sh | 8 ++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt index 6d43f56279..736d8bf887 100644 --- a/Documentation/git-format-patch.txt +++ b/Documentation/git-format-patch.txt @@ -18,7 +18,7 @@ SYNOPSIS [--start-number ] [--numbered-files] [--in-reply-to=Message-Id] [--suffix=.] [--ignore-if-in-upstream] - [--subject-prefix=Subject-Prefix] + [--subject-prefix=Subject-Prefix] [--reroll-count ] [--to=] [--cc=] [--cover-letter] [--quiet] [] @@ -166,6 +166,14 @@ will want to ensure that threading is disabled for `git send-email`. allows for useful naming of a patch series, and can be combined with the `--numbered` option. +--reroll-count=:: + Mark the series as the -th iteration of the topic. The + output filenames have `v` pretended to them, and the + subject prefix ("PATCH" by default, but configurable via the + `--subject-prefix` option) has ` v` appended to it. E.g. + `--reroll-count=4` may produce `v4-0001-add-makefile.patch` + file that has "Subject: [PATCH v4 1/20] Add makefile" in it. + --to=:: Add a `To:` header to the email headers. This is in addition to any configured headers, and may be used multiple times. diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 959aa26ef5..0ff99582c6 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -237,6 +237,14 @@ test_expect_success 'multiple files' ' ls patches/0001-Side-changes-1.patch patches/0002-Side-changes-2.patch patches/0003-Side-changes-3-with-n-backslash-n-in-it.patch ' +test_expect_success 'reroll count' ' + rm -fr patches && + git format-patch -o patches --cover-letter --reroll-count 4 master..side >list && + ! grep -v "^patches/v4-000[0-3]-" list && + sed -n -e "/^Subject: /p" $(cat list) >subjects && + ! grep -v "^Subject: \[PATCH v4 [0-3]/3\] " subjects +' + check_threading () { expect="$1" && shift && -- cgit v1.2.1 From 7952ea66e72d1129afbebcdde11dcbeecd92698a Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 2 Jan 2013 14:19:05 -0800 Subject: format-patch: give --reroll-count a short synonym -v Accept "-v" as a synonym to "--reroll-count", so that users can say "git format-patch -v4 master", instead of having to fully spell it out as "git format-patch --reroll-count=4 master". As I do not think of a reason why users would want to tell the command to be "verbose", I think this should be OK. Signed-off-by: Junio C Hamano --- Documentation/git-format-patch.txt | 3 ++- builtin/log.c | 2 +- t/t4014-format-patch.sh | 8 ++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt index 736d8bf887..ae3212e8d8 100644 --- a/Documentation/git-format-patch.txt +++ b/Documentation/git-format-patch.txt @@ -18,7 +18,7 @@ SYNOPSIS [--start-number ] [--numbered-files] [--in-reply-to=Message-Id] [--suffix=.] [--ignore-if-in-upstream] - [--subject-prefix=Subject-Prefix] [--reroll-count ] + [--subject-prefix=Subject-Prefix] [(--reroll-count|-v) ] [--to=] [--cc=] [--cover-letter] [--quiet] [] @@ -166,6 +166,7 @@ will want to ensure that threading is disabled for `git send-email`. allows for useful naming of a patch series, and can be combined with the `--numbered` option. +-v :: --reroll-count=:: Mark the series as the -th iteration of the topic. The output filenames have `v` pretended to them, and the diff --git a/builtin/log.c b/builtin/log.c index e101498faa..08e8a9d2a3 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -1081,7 +1081,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) N_("use instead of '.patch'")), OPT_INTEGER(0, "start-number", &start_number, N_("start numbering patches at instead of 1")), - OPT_INTEGER(0, "reroll-count", &reroll_count, + OPT_INTEGER('v', "reroll-count", &reroll_count, N_("mark the series as Nth re-roll")), { OPTION_CALLBACK, 0, "subject-prefix", &rev, N_("prefix"), N_("Use [] instead of [PATCH]"), diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 0ff99582c6..aa9470dbf1 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -245,6 +245,14 @@ test_expect_success 'reroll count' ' ! grep -v "^Subject: \[PATCH v4 [0-3]/3\] " subjects ' +test_expect_success 'reroll count (-v)' ' + rm -fr patches && + git format-patch -o patches --cover-letter -v4 master..side >list && + ! grep -v "^patches/v4-000[0-3]-" list && + sed -n -e "/^Subject: /p" $(cat list) >subjects && + ! grep -v "^Subject: \[PATCH v4 [0-3]/3\] " subjects +' + check_threading () { expect="$1" && shift && -- cgit v1.2.1