git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Todd Zullinger <tmz@pobox.com>
Cc: git@vger.kernel.org, "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Jeff King" <peff@peff.net>,
	"Ondřej Pohořelský" <opohorel@redhat.com>
Subject: Re: [PATCH] send-email: avoid duplicate specification warnings
Date: Wed, 15 Nov 2023 02:32:03 +0900	[thread overview]
Message-ID: <xmqqjzqkxmuk.fsf@gitster.g> (raw)
In-Reply-To: <20231114163826.207267-1-tmz@pobox.com> (Todd Zullinger's message of "Tue, 14 Nov 2023 11:38:19 -0500")

Todd Zullinger <tmz@pobox.com> writes:

> With perl-Getopt-Long >= 2.55, a warning is issued for options which are
> specified more than once.  In addition to causing users to see warnings,
> this results in test failures which compare the output.  An example,
> from t9001-send-email.37:
>
>   | +++ diff -u expect actual
>   | --- expect      2023-11-14 10:38:23.854346488 +0000
>   | +++ actual      2023-11-14 10:38:23.848346466 +0000
>   | @@ -1,2 +1,7 @@
>   | +Duplicate specification "no-chain-reply-to" for option "no-chain-reply-to"
>   | +Duplicate specification "to-cover|to-cover!" for option "to-cover"
>   | +Duplicate specification "cc-cover|cc-cover!" for option "cc-cover"
>   | +Duplicate specification "no-thread" for option "no-thread"
>   | +Duplicate specification "no-to-cover" for option "no-to-cover"
>   |  fatal: longline.patch:35 is longer than 998 characters
>   |  warning: no patches were sent
>   | error: last command exited with $?=1
>   | not ok 37 - reject long lines
>
> Remove the duplicate option specs.

As long as these manual implementation of "no-" are doing true
opposite of the positive one, it should be sufficient to remove
them, so I'd prefer to see you explicitly say that you did audit
them all to make sure.

For example,

>  		    "annotate!" => \$annotate,
> -		    "no-annotate" => sub {$annotate = 0},

this is an example of good pair.  With the former, "--no-annotate"
and "--annotate" result in $annotate set to false and true, and the
latter attempts to set $annotate to false upon "--no-annotate", so
the net result of removing the latter should be a no-op.

>  		    "suppress-from!" => \$suppress_from,
> -		    "no-suppress-from" => sub {$suppress_from = 0},

Ditto.

As it is very late at night here, I didn't do a though job to scan
and validate all of them (some did not have their positive
counterparts in the context), though.  Thanks for woking on this.


  reply	other threads:[~2023-11-14 17:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-14 16:38 [PATCH] send-email: avoid duplicate specification warnings Todd Zullinger
2023-11-14 17:32 ` Junio C Hamano [this message]
2023-11-14 20:00 ` Jeff King
2023-11-14 20:59   ` Todd Zullinger
2023-11-15  0:48     ` Junio C Hamano
2023-11-15 17:39       ` [RFC PATCH v2 0/2] " Todd Zullinger
2023-11-15 17:39         ` [RFC PATCH v2 1/2] " Todd Zullinger
2023-11-16  4:58           ` Junio C Hamano
2023-11-16 19:30             ` [PATCH v3 0/2] " Todd Zullinger
2023-11-16 19:30               ` [PATCH v3 1/2] perl: bump the required Perl version to 5.8.1 from 5.8.0 Todd Zullinger
2023-11-16 20:16                 ` Jeff King
2023-11-16 19:30               ` [PATCH v3 2/2] send-email: avoid duplicate specification warnings Todd Zullinger
2023-11-16 22:32               ` [PATCH v3 0/2] " Junio C Hamano
2023-11-15 17:39         ` [RFC PATCH v2 2/2] send-email: remove stray characters from usage Todd Zullinger
2023-11-16  4:59           ` Junio C Hamano
2023-11-16 19:36             ` [PATCH] " Todd Zullinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqjzqkxmuk.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=opohorel@redhat.com \
    --cc=peff@peff.net \
    --cc=tmz@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).