git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Brandon Casey <drafnel@gmail.com>
Date
Feb 15, 2015, 06:32 UTC
Message-ID
<CA+sFfMdVBgqV6Ar53eo_PEzHSLMc+Z_fA_ND5CBEtX8=pKvk_Q@mail.gmail.com>
In-Reply-To
<1423858769-1565-2-git-send-email-gitster@pobox.com>
On Fri, Feb 13, 2015 at 12:19 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> From: "Kyle J. McKay" <mackyle@gmail.com>
>
> 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.

Show 33 quoted lines
> Reported-by: Tom G. Christensen <tgc@statsbiblioteket.dk>
> Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>  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.
Show 19 quoted lines
> +                   "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
Previous: Junio C HamanoNext: Junio C Hamano
Message 25 of 31 in “[ANNOUNCE] Git v2.3.0-rc2”
  1. Junio C HamanoJan 27, 2015
  2. Broken makefile check for curl version on el4 [Re: [ANNOUNCE] Git v2.3.0-rc2]Tom G. Christensen, Jan 29, 2015
  3. Makefile: Handle broken curl version number in version checkTom G. Christensen, Jan 30, 2015
  4. Andreas SchwabJan 30, 2015
  5. Tom G. ChristensenJan 30, 2015
  6. Kyle J. McKayJan 30, 2015
  7. Junio C HamanoJan 30, 2015
  8. All gnupg tests broken on el4 [Re: [ANNOUNCE] Git v2.3.0-rc2]Tom G. Christensen, Jan 29, 2015
  9. Jeff KingJan 29, 2015
  10. Jeff KingJan 29, 2015
  11. Tom G. ChristensenJan 29, 2015
  12. Junio C HamanoJan 29, 2015
  13. Testsuite regression with perl 5.8.0 [Re: [ANNOUNCE] Git v2.3.0-rc2]Tom G. Christensen, Jan 29, 2015
  14. Jeff KingJan 29, 2015
  15. Tom G. ChristensenJan 30, 2015
  16. t9001: use older Getopt::Long boolean prefix '--no' rather than '--no-'Tom G. Christensen, Jan 30, 2015
  17. brian m. carlsonJan 30, 2015
  18. Kyle J. McKayJan 31, 2015
  19. Junio C HamanoFeb 2, 2015
  20. Kyle J. McKayFeb 2, 2015
  21. Junio C HamanoFeb 2, 2015
  22. Junio C HamanoFeb 12, 2015
  23. 0/2 Getopt::Long workaround in send-emailJunio C Hamano, Feb 13, 2015
  24. 1/2 git-send-email.perl: support no- prefix with older GetOptionsJunio C Hamano, Feb 13, 2015
  25. Brandon CaseyFeb 15, 2015
  26. 2/2 SQUASH??? t9001: turn --no$option workarounds to --no-$optionJunio C Hamano, Feb 13, 2015
  27. Kyle J. McKayFeb 13, 2015
  28. brian m. carlsonFeb 13, 2015
  29. Brandon CaseyFeb 15, 2015
  30. Tom G. ChristensenFeb 16, 2015
  31. Brandon CaseyFeb 16, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.