Subject: Re: Fix git-send-email.perl w.r.t. recent Getopt::Long update

From: "H.Merijn Brand" <[email-masked]>
Date: Mon, 27 Nov 2023 09:38:10 +0100

On Mon, 27 Nov 2023 09:58:52 +0900, Junio C Hamano <[email-masked]> wrote:

> "H.Merijn Brand" <[email-masked]> writes:
> 
> > From the Getopt::Long changes:
> > ```
> > Changes in version 2.55
> > -----------------------
> > * Fix long standing bug that duplicate options were not detected when
> >   the options differ in case while ignore_case is in effect.
> >   This will now yield a warning and become a fatal error in a future
> >   release.
> > ```
> >
> > Current version is 2.57  
> 
> This patch looks like duplicate of
> 
>   https://lore.kernel.org/git/[email-masked]/
> 
> perhaps independently discovered and worked on.  Thanks for caring.
> 
> One downside of unconditional upgrade of the call is, of course,
> that it would no longer work for those with older Getopt::Long that
> did not support the "!" suffix.  Fortunately, Getopt::Long 2.33
> started shipping with Perl 5.8.1 that is more than 20 years old, so
> with the series we accepted, we also have a change to bump the
> required version of Perl from 5.8.0 to 5.8.1 to make it clear that
> it is deliberate that we drop the support for anything older at the
> same time.

The is a no-issue ...

Just the 'use Getopt::Long' is enough to guarantee a working version:

The '!' was already implemented in version 2.10 (April 1997):
--8<---
=item !

Option does not take an argument and may be negated, i.e. prefixed by
"no". E.g. "foo!" will allow B<--foo> (with value 1) and B<-nofoo>
(with value 0).
The option variable will be set to 1, or 0 if negated.
-->8---

Looking at the ChangeLog,  a reliable behavior of '!' was available
since version 2.22 (march 2000):
--8<---
Changes in version 2.22
-----------------------

* Fixes a bug in the combination of aliases and negation.

  Old:  "foo|bar!" allowed negation on foo, but not on bar.
  New:  "foo|bar!" allows negation on foo and bar.

  Caveat: "foo|f!", with bundling, issues the warning that negation on
  a short option is ignored. To obtain the desired behaviour, use

        "foo!" => \$opt_foo, "f" => \$opt_foo
  or
        "foo|f" => \$opt_foo, "nofoo" => sub { $opt_foo = 0 }

  Remember that this is _only_ required when bundling is in effect.
-->8---

-- 
H.Merijn Brand  https://tux.nl   Perl Monger   http://amsterdam.pm.org/
using perl5.00307 .. 5.37        porting perl5 on HP-UX, AIX, and Linux
https://tux.nl/email.html http://qa.perl.org https://www.test-smoke.org