Merge branch 'tz/send-email-negatable-options' into maint-2.43

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
This commit is contained in:
Junio C Hamano 2024-02-08 16:22:00 -08:00
commit f8e2ad965a
22 changed files with 29 additions and 36 deletions

View File

@ -490,7 +490,7 @@ For Perl programs:
- Most of the C guidelines above apply.
- We try to support Perl 5.8 and later ("use Perl 5.008").
- We try to support Perl 5.8.1 and later ("use Perl 5.008001").
- use strict and use warnings are strongly preferred.

View File

@ -119,7 +119,7 @@ Issues of note:
- A POSIX-compliant shell is required to run some scripts needed
for everyday use (e.g. "bisect", "request-pull").
- "Perl" version 5.8 or later is needed to use some of the
- "Perl" version 5.8.1 or later is needed to use some of the
features (e.g. sending patches using "git send-email",
interacting with svn repositories with "git svn"). If you can
live without these, use NO_PERL. Note that recent releases of

View File

@ -1,6 +1,6 @@
package DiffHighlight;
use 5.008;
use 5.008001;
use warnings FATAL => 'all';
use strict;

View File

@ -1,6 +1,6 @@
package Git::Mediawiki;
use 5.008;
use 5.008001;
use strict;
use POSIX;
use Git;

View File

@ -54,7 +54,7 @@ and can contain multiple, unrelated branches.
=cut
use 5.008;
use 5.008001;
use strict;
use warnings;
use Getopt::Std;

View File

@ -1,6 +1,6 @@
#!/usr/bin/perl
use 5.008;
use 5.008001;
use strict;
use warnings;
use Getopt::Std;

View File

@ -13,7 +13,7 @@
# The head revision is on branch "origin" by default.
# You can change that with the '-o' option.
use 5.008;
use 5.008001;
use strict;
use warnings;
use Getopt::Long;

View File

@ -15,7 +15,7 @@
####
####
use 5.008;
use 5.008001;
use strict;
use warnings;
use bytes;

View File

@ -16,7 +16,7 @@
# and second line is the subject of the message.
#
use 5.008;
use 5.008001;
use strict;
use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
use Getopt::Long;
@ -119,13 +119,16 @@ sub completion_helper {
foreach my $key (keys %$original_opts) {
unless (exists $not_for_completion{$key}) {
$key =~ s/!$//;
my $negatable = ($key =~ s/!$//);
if ($key =~ /[:=][si]$/) {
$key =~ s/[:=][si]$//;
push (@send_email_opts, "--$_=") foreach (split (/\|/, $key));
} else {
push (@send_email_opts, "--$_") foreach (split (/\|/, $key));
if ($negatable) {
push (@send_email_opts, "--no-$_") foreach (split (/\|/, $key));
}
}
}
}
@ -228,7 +231,7 @@ sub system_or_msg {
my @sprintf_args = ($cmd_name ? $cmd_name : $args->[0], $exit_code);
if (defined $msg) {
# Quiet the 'redundant' warning category, except we
# need to support down to Perl 5.8, so we can't do a
# need to support down to Perl 5.8.1, so we can't do a
# "no warnings 'redundant'", since that category was
# introduced in perl 5.22, and asking for it will die
# on older perls.
@ -491,7 +494,6 @@ my %options = (
"bcc=s" => \@getopt_bcc,
"no-bcc" => \$no_bcc,
"chain-reply-to!" => \$chain_reply_to,
"no-chain-reply-to" => sub {$chain_reply_to = 0},
"sendmail-cmd=s" => \$sendmail_cmd,
"smtp-server=s" => \$smtp_server,
"smtp-server-option=s" => \@smtp_server_options,
@ -506,36 +508,27 @@ my %options = (
"smtp-auth=s" => \$smtp_auth,
"no-smtp-auth" => sub {$smtp_auth = 'none'},
"annotate!" => \$annotate,
"no-annotate" => sub {$annotate = 0},
"compose" => \$compose,
"quiet" => \$quiet,
"cc-cmd=s" => \$cc_cmd,
"header-cmd=s" => \$header_cmd,
"no-header-cmd" => \$no_header_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},
"cc-cover!" => \$cover_cc,
"to-cover!" => \$cover_to,
"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},
"batch-size=i" => \$batch_size,
"relogin-delay=i" => \$relogin_delay,
"git-completion-helper" => \$git_completion_helper,

View File

@ -1,7 +1,7 @@
#!/usr/bin/perl
# Copyright (C) 2006, Eric Wong <normalperson@yhbt.net>
# License: GPL v2 or later
use 5.008;
use 5.008001;
use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
use strict;
use vars qw/ $AUTHOR $VERSION

View File

@ -29,7 +29,7 @@ Requirements
------------
- Core git tools
- Perl 5.8
- Perl 5.8.1
- Perl modules: CGI, Encode, Fcntl, File::Find, File::Basename.
- web server

View File

@ -7,7 +7,7 @@
#
# This program is licensed under the GPLv2
use 5.008;
use 5.008001;
use strict;
use warnings;
# handle ACL in file access tests

View File

@ -7,7 +7,7 @@ Git - Perl interface to the Git version control system
package Git;
use 5.008;
use 5.008001;
use strict;
use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();

View File

@ -1,5 +1,5 @@
package Git::I18N;
use 5.008;
use 5.008001;
use strict;
use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
BEGIN {

View File

@ -1,5 +1,5 @@
package Git::LoadCPAN;
use 5.008;
use 5.008001;
use strict;
use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();

View File

@ -1,5 +1,5 @@
package Git::LoadCPAN::Error;
use 5.008;
use 5.008001;
use strict;
use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
use Git::LoadCPAN (

View File

@ -1,5 +1,5 @@
package Git::LoadCPAN::Mail::Address;
use 5.008;
use 5.008001;
use strict;
use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
use Git::LoadCPAN (

View File

@ -1,5 +1,5 @@
package Git::Packet;
use 5.008;
use 5.008001;
use strict;
use warnings $ENV{GIT_PERL_FATAL_WARNINGS} ? qw(FATAL all) : ();
BEGIN {

View File

@ -1,5 +1,5 @@
#!/usr/bin/perl
use 5.008;
use 5.008001;
use lib (split(/:/, $ENV{GITPERLLIB}));
use strict;
use warnings;

View File

@ -1,4 +1,4 @@
use 5.008;
use 5.008001;
use strict;
use warnings;

View File

@ -1,7 +1,7 @@
#!/usr/bin/perl
use lib (split(/:/, $ENV{GITPERLLIB}));
use 5.008;
use 5.008001;
use warnings;
use strict;

View File

@ -1,5 +1,5 @@
#!/usr/bin/perl
use 5.008;
use 5.008001;
use strict;
use warnings;
use IO::Pty;