format-patch: give --reroll-count a short synonym -v
authorJunio C Hamano <gitster@pobox.com>
Wed, 2 Jan 2013 22:19:05 +0000 (14:19 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 4 Jan 2013 00:05:44 +0000 (16:05 -0800)
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 <gitster@pobox.com>
Documentation/git-format-patch.txt
builtin/log.c
t/t4014-format-patch.sh

index 736d8bf887d2cb272ab8992f07dc1a31cf389061..ae3212e8d8b1bcdbf19c37295b8d993c33bb3e9b 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] [--reroll-count <n>]
+                  [--subject-prefix=Subject-Prefix] [(--reroll-count|-v) <n>]
                   [--to=<email>] [--cc=<email>]
                   [--cover-letter] [--quiet]
                   [<common diff options>]
@@ -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 <n>::
 --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
index e101498faae8ace554c76454afe23473b740d08f..08e8a9d2a3e5d19833cb0f48347f6ba214f280c9 100644 (file)
@@ -1081,7 +1081,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
                            N_("use <sfx> instead of '.patch'")),
                OPT_INTEGER(0, "start-number", &start_number,
                            N_("start numbering patches at <n> 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 [<prefix>] instead of [PATCH]"),
index 0ff99582c6e68844d672e3982f49d216d2014587..aa9470dbf1fcca71998a41876709da4bf40c74ad 100755 (executable)
@@ -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 &&