format-patch: document and test --reroll-count
authorJunio C Hamano <gitster@pobox.com>
Wed, 2 Jan 2013 22:16:07 +0000 (14:16 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 Jan 2013 22:16:07 +0000 (14:16 -0800)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-format-patch.txt
t/t4014-format-patch.sh

index 6d43f56279fe7a0d42510035e33424df0bc584f1..736d8bf887d2cb272ab8992f07dc1a31cf389061 100644 (file)
@@ -18,7 +18,7 @@ SYNOPSIS
                   [--start-number <n>] [--numbered-files]
                   [--in-reply-to=Message-Id] [--suffix=.<sfx>]
                   [--ignore-if-in-upstream]
-                  [--subject-prefix=Subject-Prefix]
+                  [--subject-prefix=Subject-Prefix] [--reroll-count <n>]
                   [--to=<email>] [--cc=<email>]
                   [--cover-letter] [--quiet]
                   [<common diff options>]
@@ -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=<n>::
+       Mark the series as the <n>-th iteration of the topic. The
+       output filenames have `v<n>` pretended to them, and the
+       subject prefix ("PATCH" by default, but configurable via the
+       `--subject-prefix` option) has ` v<n>` 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=<email>::
        Add a `To:` header to the email headers. This is in addition
        to any configured headers, and may be used multiple times.
index 959aa26ef5d96f4be79e6051fb6ae159e03b556e..0ff99582c6e68844d672e3982f49d216d2014587 100755 (executable)
@@ -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 &&