Skip to content

Commit 1ef1cce

Browse files
committed
Merge branch 'tz/send-email-negatable-options'
Newer versions of Getopt::Long started giving warnings against our (ab)use of it in "git send-email". Bump the minimum version requirement for Perl to 5.8.1 (from September 2002) to allow simplifying our implementation. * tz/send-email-negatable-options: send-email: avoid duplicate specification warnings perl: bump the required Perl version to 5.8.1 from 5.8.0
2 parents f8f87e0 + 6ff658c commit 1ef1cce

22 files changed

+29
-36
lines changed

Documentation/CodingGuidelines

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ For Perl programs:
490490

491491
- Most of the C guidelines above apply.
492492

493-
- We try to support Perl 5.8 and later ("use Perl 5.008").
493+
- We try to support Perl 5.8.1 and later ("use Perl 5.008001").
494494

495495
- use strict and use warnings are strongly preferred.
496496

INSTALL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Issues of note:
119119
- A POSIX-compliant shell is required to run some scripts needed
120120
for everyday use (e.g. "bisect", "request-pull").
121121

122-
- "Perl" version 5.8 or later is needed to use some of the
122+
- "Perl" version 5.8.1 or later is needed to use some of the
123123
features (e.g. sending patches using "git send-email",
124124
interacting with svn repositories with "git svn"). If you can
125125
live without these, use NO_PERL. Note that recent releases of

contrib/diff-highlight/DiffHighlight.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package DiffHighlight;
22

3-
use 5.008;
3+
use 5.008001;
44
use warnings FATAL => 'all';
55
use strict;
66

contrib/mw-to-git/Git/Mediawiki.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package Git::Mediawiki;
22

3-
use 5.008;
3+
use 5.008001;
44
use strict;
55
use POSIX;
66
use Git;

git-archimport.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ =head1 Devel Notes
5454
5555
=cut
5656

57-
use 5.008;
57+
use 5.008001;
5858
use strict;
5959
use warnings;
6060
use Getopt::Std;

git-cvsexportcommit.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/perl
22

3-
use 5.008;
3+
use 5.008001;
44
use strict;
55
use warnings;
66
use Getopt::Std;

git-cvsimport.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# The head revision is on branch "origin" by default.
1414
# You can change that with the '-o' option.
1515

16-
use 5.008;
16+
use 5.008001;
1717
use strict;
1818
use warnings;
1919
use Getopt::Long;

git-cvsserver.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
####
1616
####
1717

18-
use 5.008;
18+
use 5.008001;
1919
use strict;
2020
use warnings;
2121
use bytes;

git-send-email.perl

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# and second line is the subject of the message.
1717
#
1818

19-
use 5.008;
19+
use 5.008001;
2020
use strict;
2121
use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
2222
use Getopt::Long;
@@ -119,13 +119,16 @@ sub completion_helper {
119119

120120
foreach my $key (keys %$original_opts) {
121121
unless (exists $not_for_completion{$key}) {
122-
$key =~ s/!$//;
122+
my $negatable = ($key =~ s/!$//);
123123

124124
if ($key =~ /[:=][si]$/) {
125125
$key =~ s/[:=][si]$//;
126126
push (@send_email_opts, "--$_=") foreach (split (/\|/, $key));
127127
} else {
128128
push (@send_email_opts, "--$_") foreach (split (/\|/, $key));
129+
if ($negatable) {
130+
push (@send_email_opts, "--no-$_") foreach (split (/\|/, $key));
131+
}
129132
}
130133
}
131134
}
@@ -228,7 +231,7 @@ sub system_or_msg {
228231
my @sprintf_args = ($cmd_name ? $cmd_name : $args->[0], $exit_code);
229232
if (defined $msg) {
230233
# Quiet the 'redundant' warning category, except we
231-
# need to support down to Perl 5.8, so we can't do a
234+
# need to support down to Perl 5.8.1, so we can't do a
232235
# "no warnings 'redundant'", since that category was
233236
# introduced in perl 5.22, and asking for it will die
234237
# on older perls.
@@ -491,7 +494,6 @@ sub config_regexp {
491494
"bcc=s" => \@getopt_bcc,
492495
"no-bcc" => \$no_bcc,
493496
"chain-reply-to!" => \$chain_reply_to,
494-
"no-chain-reply-to" => sub {$chain_reply_to = 0},
495497
"sendmail-cmd=s" => \$sendmail_cmd,
496498
"smtp-server=s" => \$smtp_server,
497499
"smtp-server-option=s" => \@smtp_server_options,
@@ -506,36 +508,27 @@ sub config_regexp {
506508
"smtp-auth=s" => \$smtp_auth,
507509
"no-smtp-auth" => sub {$smtp_auth = 'none'},
508510
"annotate!" => \$annotate,
509-
"no-annotate" => sub {$annotate = 0},
510511
"compose" => \$compose,
511512
"quiet" => \$quiet,
512513
"cc-cmd=s" => \$cc_cmd,
513514
"header-cmd=s" => \$header_cmd,
514515
"no-header-cmd" => \$no_header_cmd,
515516
"suppress-from!" => \$suppress_from,
516-
"no-suppress-from" => sub {$suppress_from = 0},
517517
"suppress-cc=s" => \@suppress_cc,
518518
"signed-off-cc|signed-off-by-cc!" => \$signed_off_by_cc,
519-
"no-signed-off-cc|no-signed-off-by-cc" => sub {$signed_off_by_cc = 0},
520-
"cc-cover|cc-cover!" => \$cover_cc,
521-
"no-cc-cover" => sub {$cover_cc = 0},
522-
"to-cover|to-cover!" => \$cover_to,
523-
"no-to-cover" => sub {$cover_to = 0},
519+
"cc-cover!" => \$cover_cc,
520+
"to-cover!" => \$cover_to,
524521
"confirm=s" => \$confirm,
525522
"dry-run" => \$dry_run,
526523
"envelope-sender=s" => \$envelope_sender,
527524
"thread!" => \$thread,
528-
"no-thread" => sub {$thread = 0},
529525
"validate!" => \$validate,
530-
"no-validate" => sub {$validate = 0},
531526
"transfer-encoding=s" => \$target_xfer_encoding,
532527
"format-patch!" => \$format_patch,
533-
"no-format-patch" => sub {$format_patch = 0},
534528
"8bit-encoding=s" => \$auto_8bit_encoding,
535529
"compose-encoding=s" => \$compose_encoding,
536530
"force" => \$force,
537531
"xmailer!" => \$use_xmailer,
538-
"no-xmailer" => sub {$use_xmailer = 0},
539532
"batch-size=i" => \$batch_size,
540533
"relogin-delay=i" => \$relogin_delay,
541534
"git-completion-helper" => \$git_completion_helper,

git-svn.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/perl
22
# Copyright (C) 2006, Eric Wong <[email protected]>
33
# License: GPL v2 or later
4-
use 5.008;
4+
use 5.008001;
55
use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
66
use strict;
77
use vars qw/ $AUTHOR $VERSION

gitweb/INSTALL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Requirements
2929
------------
3030

3131
- Core git tools
32-
- Perl 5.8
32+
- Perl 5.8.1
3333
- Perl modules: CGI, Encode, Fcntl, File::Find, File::Basename.
3434
- web server
3535

gitweb/gitweb.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
# This program is licensed under the GPLv2
99

10-
use 5.008;
10+
use 5.008001;
1111
use strict;
1212
use warnings;
1313
# handle ACL in file access tests

perl/Git.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Git - Perl interface to the Git version control system
77

88
package Git;
99

10-
use 5.008;
10+
use 5.008001;
1111
use strict;
1212
use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
1313

perl/Git/I18N.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package Git::I18N;
2-
use 5.008;
2+
use 5.008001;
33
use strict;
44
use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
55
BEGIN {

perl/Git/LoadCPAN.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package Git::LoadCPAN;
2-
use 5.008;
2+
use 5.008001;
33
use strict;
44
use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
55

perl/Git/LoadCPAN/Error.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package Git::LoadCPAN::Error;
2-
use 5.008;
2+
use 5.008001;
33
use strict;
44
use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
55
use Git::LoadCPAN (

perl/Git/LoadCPAN/Mail/Address.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package Git::LoadCPAN::Mail::Address;
2-
use 5.008;
2+
use 5.008001;
33
use strict;
44
use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
55
use Git::LoadCPAN (

perl/Git/Packet.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package Git::Packet;
2-
use 5.008;
2+
use 5.008001;
33
use strict;
44
use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
55
BEGIN {

t/t0202/test.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/perl
2-
use 5.008;
2+
use 5.008001;
33
use lib (split(/:/, $ENV{GITPERLLIB}));
44
use strict;
55
use warnings;

t/t5562/invoke-with-content-length.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use 5.008;
1+
use 5.008001;
22
use strict;
33
use warnings;
44

t/t9700/test.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/perl
22
use lib (split(/:/, $ENV{GITPERLLIB}));
33

4-
use 5.008;
4+
use 5.008001;
55
use warnings;
66
use strict;
77

t/test-terminal.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/perl
2-
use 5.008;
2+
use 5.008001;
33
use strict;
44
use warnings;
55
use IO::Pty;

0 commit comments

Comments
 (0)