git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Todd Zullinger <tmz@pobox.com>
Cc: git@vger.kernel.org, "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Ondřej Pohořelský" <opohorel@redhat.com>
Subject: Re: [PATCH] send-email: avoid duplicate specification warnings
Date: Tue, 14 Nov 2023 15:00:09 -0500	[thread overview]
Message-ID: <20231114200009.GD2092538@coredump.intra.peff.net> (raw)
In-Reply-To: <20231114163826.207267-1-tmz@pobox.com>

On Tue, Nov 14, 2023 at 11:38:19AM -0500, Todd Zullinger wrote:

> 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:

This made me wonder if the warnings are new, or if the duplicated
auto-negated options are new. I.e., were the manual "--no-foo" option
specs doing something useful in the older versions (in which case we'd
need to do something more complicated)?

But I think the answer is no.  We've explicitly marked these with "!" to
indicate that they're negatable. And certainly running with Getopt::Long
2.52 (from perl 5.36, which is the current in Debian unstable) seems to
support them.

It does make me wonder why some boolean options are not marked as
negatable (even if just to countermand an earlier option), but that is
outside the scope of your patch.

> I've run this through the full test suite.  I also compared the output of
> --help to ensure it only differs in the removal of the "Duplicate
> specification" warnings.  I _think_ that's a good sign that no other changes
> will result.  But I would be grateful to anyone who can confirm or reject that
> theory.

I guess you meant "-h", not "--help", since the latter will just show
the manpage. But isn't "-h" just dumping a static usage message we
wrote, and not auto-generated by the code?

The changes look good to me (even after double-checking Junio's question
that they are all appropriately matched with their "positive" sides).
This one is curious:

> -		    "cc-cover|cc-cover!" => \$cover_cc,

It was an alternate name for itself? I think somebody just misunderstood
how the API was supposed to work. The "!" would applies to all names, if
I understand correctly, so this really is doing nothing beyond just
"cc-cover!", which is what your patch switches it to.

-Peff


  parent reply	other threads:[~2023-11-14 20:00 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
2023-11-14 20:00 ` Jeff King [this message]
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=20231114200009.GD2092538@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=opohorel@redhat.com \
    --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).