]> git.ipfire.org Git - thirdparty/git.git/commit
send-email: relay '-v N' to format-patch
authorKyle Meyer <kyle@kyleam.com>
Sat, 26 Nov 2022 20:21:23 +0000 (15:21 -0500)
committerJunio C Hamano <gitster@pobox.com>
Sun, 27 Nov 2022 01:21:43 +0000 (10:21 +0900)
commit8774aa56ad1af286b34e6ac7f1e65c75a4477fdd
treee81e7e3e16a651b2f387934cf438d8b4b681f72c
parentc000d916380bb59db69c78546928eadd076b9c7d
send-email: relay '-v N' to format-patch

send-email relays unrecognized arguments to its format-patch call.
Passing '-v N' leads to an error because -v is consumed as
send-email's --validate.  For example,

  git send-email -v 3 @{u}

fails with

  fatal: ambiguous argument '3': unknown revision or path not in the
  working tree.  [...]

To prevent this, add the short --reroll-count option to send-email's
main option list and explicitly provide it to the format-patch call.

There other format-patch options that send-email doesn't relay
properly, including at least -n, -N, and the diff option -D.  Punt on
these because dealing with them is more complicated:

 * they would require configuring send-email to not ignore option case

 * send-email makes three GetOptions() calls with different sets of
   options, the last being the main set of options.  Unlike -v, which
   is consumed by the last GetOptions call, the -n, -N, and -D options
   are consumed as abbreviations by the earlier calls.

Signed-off-by: Kyle Meyer <kyle@kyleam.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-send-email.perl
t/t9001-send-email.sh