summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle J. McKay <mackyle@gmail.com>2015-01-30 18:40:17 -0800
committerJunio C Hamano <gitster@pobox.com>2015-02-16 13:26:51 -0800
commitf471494303c2d2a085f384eac705379ef2423590 (patch)
tree4d87da7c7878def23b291d254285396fd9724766
parent15598cf41beed0d86cd2ac443e0f69c5a3b40321 (diff)
downloadgit-km/send-email-getopt-long-workarounds.tar.gz
git-send-email.perl: support no- prefix with older GetOptionskm/send-email-getopt-long-workarounds
Only Perl version 5.8.0 or later is required, but that comes with an older Getopt::Long (2.32) that does not support the 'no-' prefix. Support for that was added in Getopt::Long version 2.33. Since the help only mentions the 'no-' prefix and not the 'no' prefix, add explicit support for the 'no-' prefix to support older GetOptions versions. Reported-by: Tom G. Christensen <tgc@statsbiblioteket.dk> Signed-off-by: Kyle J. McKay <mackyle@gmail.com> Tested-by: Tom G. Christensen <tgc@statsbiblioteket.dk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xgit-send-email.perl10
-rwxr-xr-xt/t9001-send-email.sh10
2 files changed, 15 insertions, 5 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index 3092ab356c..a18a7959ed 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -299,6 +299,7 @@ my $rc = GetOptions("h" => \$help,
"bcc=s" => \@bcclist,
"no-bcc" => \$no_bcc,
"chain-reply-to!" => \$chain_reply_to,
+ "no-chain-reply-to" => sub {$chain_reply_to = 0},
"smtp-server=s" => \$smtp_server,
"smtp-server-option=s" => \@smtp_server_options,
"smtp-server-port=s" => \$smtp_server_port,
@@ -311,25 +312,34 @@ my $rc = GetOptions("h" => \$help,
"smtp-domain:s" => \$smtp_domain,
"identity=s" => \$identity,
"annotate!" => \$annotate,
+ "no-annotate" => sub {$annotate = 0},
"compose" => \$compose,
"quiet" => \$quiet,
"cc-cmd=s" => \$cc_cmd,
"suppress-from!" => \$suppress_from,
+ "no-suppress-from" => sub {$suppress_from = 0},
"suppress-cc=s" => \@suppress_cc,
"signed-off-cc|signed-off-by-cc!" => \$signed_off_by_cc,
+ "no-signed-off-cc|no-signed-off-by-cc" => sub {$signed_off_by_cc = 0},
"cc-cover|cc-cover!" => \$cover_cc,
+ "no-cc-cover" => sub {$cover_cc = 0},
"to-cover|to-cover!" => \$cover_to,
+ "no-to-cover" => sub {$cover_to = 0},
"confirm=s" => \$confirm,
"dry-run" => \$dry_run,
"envelope-sender=s" => \$envelope_sender,
"thread!" => \$thread,
+ "no-thread" => sub {$thread = 0},
"validate!" => \$validate,
+ "no-validate" => sub {$validate = 0},
"transfer-encoding=s" => \$target_xfer_encoding,
"format-patch!" => \$format_patch,
+ "no-format-patch" => sub {$format_patch = 0},
"8bit-encoding=s" => \$auto_8bit_encoding,
"compose-encoding=s" => \$compose_encoding,
"force" => \$force,
"xmailer!" => \$use_xmailer,
+ "no-xmailer" => sub {$use_xmailer = 0},
);
usage() if $help;
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index af6a3e8904..051305545c 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -392,7 +392,7 @@ test_expect_success $PREREQ 'allow long lines with --no-validate' '
--from="Example <nobody@example.com>" \
--to=nobody@example.com \
--smtp-server="$(pwd)/fake.sendmail" \
- --novalidate \
+ --no-validate \
$patches longline.patch \
2>errors
'
@@ -426,7 +426,7 @@ test_expect_success $PREREQ 'In-Reply-To without --chain-reply-to' '
git send-email \
--from="Example <nobody@example.com>" \
--to=nobody@example.com \
- --nochain-reply-to \
+ --no-chain-reply-to \
--in-reply-to="$(cat expect)" \
--smtp-server="$(pwd)/fake.sendmail" \
$patches $patches $patches \
@@ -1067,7 +1067,7 @@ test_expect_success $PREREQ 'in-reply-to but no threading' '
--from="Example <nobody@example.com>" \
--to=nobody@example.com \
--in-reply-to="<in-reply-id@example.com>" \
- --nothread \
+ --no-thread \
$patches |
grep "In-Reply-To: <in-reply-id@example.com>"
'
@@ -1077,7 +1077,7 @@ test_expect_success $PREREQ 'no in-reply-to and no threading' '
--dry-run \
--from="Example <nobody@example.com>" \
--to=nobody@example.com \
- --nothread \
+ --no-thread \
$patches $patches >stdout &&
! grep "In-Reply-To: " stdout
'
@@ -1088,7 +1088,7 @@ test_expect_success $PREREQ 'threading but no chain-reply-to' '
--from="Example <nobody@example.com>" \
--to=nobody@example.com \
--thread \
- --nochain-reply-to \
+ --no-chain-reply-to \
$patches $patches >stdout &&
grep "In-Reply-To: " stdout
'