Re: [PATCH 1/2] git-send-email.perl: support no- prefix with older GetOptions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 13, 2015 at 12:19 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> From: "Kyle J. McKay" <mackyle@xxxxxxxxx>
>
> 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 when running
> with older GetOptions versions.

ultra-ultra-nit: s/when running/for when running/  The current wording
makes it sound like the explicit support is only enabled when running
with older GetOpt versions.

> Reported-by: Tom G. Christensen <tgc@xxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Kyle J. McKay <mackyle@xxxxxxxxx>
> Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx>
> ---
>  git-send-email.perl | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/git-send-email.perl b/git-send-email.perl
> index 3092ab3..a18a795 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -299,6 +299,7 @@ sub signal_handler {
>                     "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 @@ sub signal_handler {
>                     "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,

I know it's not part of this patch, but does the above duplication of
"cc-cover" do something I'm not aware of?  Or should it just be
"cc-cover!"?

> +                   "no-cc-cover" => sub {$cover_cc = 0},
>                     "to-cover|to-cover!" => \$cover_to,

Here (above) too.

> +                   "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;

Looks fine to me.

-Brandon
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]