Skip to content

Commit 7952ea6

Browse files
committed
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 <[email protected]>
1 parent 4aad08e commit 7952ea6

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

Documentation/git-format-patch.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ SYNOPSIS
1818
[--start-number <n>] [--numbered-files]
1919
[--in-reply-to=Message-Id] [--suffix=.<sfx>]
2020
[--ignore-if-in-upstream]
21-
[--subject-prefix=Subject-Prefix] [--reroll-count <n>]
21+
[--subject-prefix=Subject-Prefix] [(--reroll-count|-v) <n>]
2222
[--to=<email>] [--cc=<email>]
2323
[--cover-letter] [--quiet]
2424
[<common diff options>]
@@ -166,6 +166,7 @@ will want to ensure that threading is disabled for `git send-email`.
166166
allows for useful naming of a patch series, and can be
167167
combined with the `--numbered` option.
168168

169+
-v <n>::
169170
--reroll-count=<n>::
170171
Mark the series as the <n>-th iteration of the topic. The
171172
output filenames have `v<n>` pretended to them, and the

builtin/log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
10811081
N_("use <sfx> instead of '.patch'")),
10821082
OPT_INTEGER(0, "start-number", &start_number,
10831083
N_("start numbering patches at <n> instead of 1")),
1084-
OPT_INTEGER(0, "reroll-count", &reroll_count,
1084+
OPT_INTEGER('v', "reroll-count", &reroll_count,
10851085
N_("mark the series as Nth re-roll")),
10861086
{ OPTION_CALLBACK, 0, "subject-prefix", &rev, N_("prefix"),
10871087
N_("Use [<prefix>] instead of [PATCH]"),

t/t4014-format-patch.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,14 @@ test_expect_success 'reroll count' '
245245
! grep -v "^Subject: \[PATCH v4 [0-3]/3\] " subjects
246246
'
247247

248+
test_expect_success 'reroll count (-v)' '
249+
rm -fr patches &&
250+
git format-patch -o patches --cover-letter -v4 master..side >list &&
251+
! grep -v "^patches/v4-000[0-3]-" list &&
252+
sed -n -e "/^Subject: /p" $(cat list) >subjects &&
253+
! grep -v "^Subject: \[PATCH v4 [0-3]/3\] " subjects
254+
'
255+
248256
check_threading () {
249257
expect="$1" &&
250258
shift &&

0 commit comments

Comments
 (0)