format-patch: document and test --reroll-count
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Jan 2, 2013 at 14:16 UTC
4aad08e061df699b49e24c4d34698d734473fb66
2 files changed
+17
-1
Documentation/git-format-patch.txt
+9
-1
@@ -18,7 +18,7 @@ SYNOPSIS
18
[--start-number <n>] [--numbered-files]
19
[--in-reply-to=Message-Id] [--suffix=.<sfx>]
20
[--ignore-if-in-upstream]
21
- [--subject-prefix=Subject-Prefix]
21
+ [--subject-prefix=Subject-Prefix] [--reroll-count <n>]
22
[--to=<email>] [--cc=<email>]
23
[--cover-letter] [--quiet]
24
[<common diff options>]
@@ -166,6 +166,14 @@ will want to ensure that threading is disabled for `git send-email`.
166
allows for useful naming of a patch series, and can be
167
combined with the `--numbered` option.
168
169
+--reroll-count=<n>::
170
+ Mark the series as the <n>-th iteration of the topic. The
171
+ output filenames have `v<n>` pretended to them, and the
172
+ subject prefix ("PATCH" by default, but configurable via the
173
+ `--subject-prefix` option) has ` v<n>` appended to it. E.g.
174
+ `--reroll-count=4` may produce `v4-0001-add-makefile.patch`
175
+ file that has "Subject: [PATCH v4 1/20] Add makefile" in it.
176
+
177
--to=<email>::
178
Add a `To:` header to the email headers. This is in addition
179
to any configured headers, and may be used multiple times.
t/t4014-format-patch.sh
+8
@@ -237,6 +237,14 @@ test_expect_success 'multiple files' '
237
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
238
'
239
240
+test_expect_success 'reroll count' '
241
+ rm -fr patches &&
242
+ git format-patch -o patches --cover-letter --reroll-count 4 master..side >list &&
243
+ ! grep -v "^patches/v4-000[0-3]-" list &&
244
+ sed -n -e "/^Subject: /p" $(cat list) >subjects &&
245
+ ! grep -v "^Subject: \[PATCH v4 [0-3]/3\] " subjects
246
+'
247
+
248
check_threading () {
249
expect="$1" &&
250
shift &&