{"thread":{"id":"60553","subject":"Fix git-send-email.perl w.r.t. recent Getopt::Long update","startedAt":"2023-11-24T09:48:25Z","lastAt":"2023-11-28T02:07:08Z","messageCount":8,"participants":["H.Merijn Brand","Bagas Sanjaya","Dragan Simic","Junio C Hamano","Jeff King","Todd Zullinger"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"485103","messageId":"20231124103932.31ca7688@pc09","threadId":"60553","inReplyTo":null,"subject":"Fix git-send-email.perl w.r.t. recent Getopt::Long update","fromName":"H.Merijn Brand","fromEmail":"linux@tux.freedom.nl","sentAt":"2023-11-24T09:39:32Z","receivedAt":"2023-11-24T09:48:25Z","isPatch":false,"sender":{"key":"linux@tux.freedom.nl","avatar":"https://gravatar.com/avatar/2c89aaef31466fa10e55c481a4b875828a741dd42413cbcf61aa1e6c0cbfa3bd?d=mp&s=160"},"body":"Patch attached\n\nFrom the Getopt::Long changes:\n```\nChanges in version 2.55\n-----------------------\n* Fix long standing bug that duplicate options were not detected when\n  the options differ in case while ignore_case is in effect.\n  This will now yield a warning and become a fatal error in a future\n  release.\n```\n\nCurrent version is 2.57\n\n\n```\ngit-2.43.0 🐧 perl -Iperl git-send-email.perl --help\nDuplicate specification \"cc-cover|cc-cover!\" for option \"cc-cover\"\nDuplicate specification \"no-cc-cover\" for option \"no-cc-cover\"\nDuplicate specification \"to-cover|to-cover!\" for option \"to-cover\"\nDuplicate specification \"no-annotate\" for option \"no-annotate\"\nDuplicate specification \"no-format-patch\" for option \"no-format-patch\"\nDuplicate specification \"no-signed-off-cc|no-signed-off-by-cc\" for option \"no-signed-off-cc\"\nDuplicate specification \"no-signed-off-cc|no-signed-off-by-cc\" for option \"no-signed-off-by-cc\"\nDuplicate specification \"no-validate\" for option \"no-validate\"\nDuplicate specification \"no-chain-reply-to\" for option \"no-chain-reply-to\"\n```\n\n`\"option!\" => \\$value`\n\n*automatically* supports both `--option` and `--no-option` and `--nooption`\n\nSee the docs for Getopt::Long:\n```\n The argument specification can be\n\n !   The option does not take an argument and may be negated by\n     prefixing it with \"no\" or \"no-\". E.g. \"foo!\" will allow \"--foo\" (a\n     value of 1 will be assigned) as well as \"--nofoo\" and \"--no-foo\" (a\n     value of 0 will be assigned). If the option has aliases, this\n     applies to the aliases as well.\n\n     Using negation on a single letter option when bundling is in effect\n     is pointless and will result in a warning.\n```\n\n\n-- \nH.Merijn Brand  https://tux.nl   Perl Monger   http://amsterdam.pm.org/\nusing perl5.00307 .. 5.37        porting perl5 on HP-UX, AIX, and Linux\nhttps://tux.nl/email.html http://qa.perl.org https://www.test-smoke.org\n                           \n\n\nFrom 206ace60f7045e309e506a1b9de775f4e9a43b46 Mon Sep 17 00:00:00 2001\nFrom: \"H.Merijn Brand - Tux\" <linux@tux.freedom.nl>\nDate: Fri, 24 Nov 2023 10:27:35 +0100\nSubject: [PATCH] perl Getopt::Long now issues warnings for duplicate options\n\n$ perl -Iperl git-send-email.perl.org --help\nDuplicate specification \"no-validate\" for option \"no-validate\"\nDuplicate specification \"to-cover|to-cover!\" for option \"to-cover\"\nDuplicate specification \"no-signed-off-cc|no-signed-off-by-cc\" for option \"no-signed-off-cc\"\nDuplicate specification \"no-signed-off-cc|no-signed-off-by-cc\" for option \"no-signed-off-by-cc\"\nDuplicate specification \"no-format-patch\" for option \"no-format-patch\"\nDuplicate specification \"cc-cover|cc-cover!\" for option \"cc-cover\"\nDuplicate specification \"no-annotate\" for option \"no-annotate\"\nDuplicate specification \"no-chain-reply-to\" for option \"no-chain-reply-to\"\nDuplicate specification \"no-cc-cover\" for option \"no-cc-cover\"\n\n\"option!\" => \\$value\n\n*automatically* supports both --option and --no-option and --nooption\n\n The argument specification can be\n\n !   The option does not take an argument and may be negated by\n     prefixing it with \"no\" or \"no-\". E.g. \"foo!\" will allow \"--foo\" (a\n     value of 1 will be assigned) as well as \"--nofoo\" and \"--no-foo\" (a\n     value of 0 will be assigned). If the option has aliases, this\n     applies to the aliases as well.\n\n     Using negation on a single letter option when bundling is in effect\n     is pointless and will result in a warning.\n\nSigned-off-by: H.Merijn Brand - Tux <linux@tux.freedom.nl>\n---\n git-send-email.perl | 14 ++------------\n 1 file changed, 2 insertions(+), 12 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex d24e981d61..125f49cd08 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -491,7 +491,6 @@ sub config_regexp {\n \t\t    \"bcc=s\" => \\@getopt_bcc,\n \t\t    \"no-bcc\" => \\$no_bcc,\n \t\t    \"chain-reply-to!\" => \\$chain_reply_to,\n-\t\t    \"no-chain-reply-to\" => sub {$chain_reply_to = 0},\n \t\t    \"sendmail-cmd=s\" => \\$sendmail_cmd,\n \t\t    \"smtp-server=s\" => \\$smtp_server,\n \t\t    \"smtp-server-option=s\" => \\@smtp_server_options,\n@@ -506,36 +505,27 @@ sub config_regexp {\n \t\t    \"smtp-auth=s\" => \\$smtp_auth,\n \t\t    \"no-smtp-auth\" => sub {$smtp_auth = 'none'},\n \t\t    \"annotate!\" => \\$annotate,\n-\t\t    \"no-annotate\" => sub {$annotate = 0},\n \t\t    \"compose\" => \\$compose,\n \t\t    \"quiet\" => \\$quiet,\n \t\t    \"cc-cmd=s\" => \\$cc_cmd,\n \t\t    \"header-cmd=s\" => \\$header_cmd,\n \t\t    \"no-header-cmd\" => \\$no_header_cmd,\n \t\t    \"suppress-from!\" => \\$suppress_from,\n-\t\t    \"no-suppress-from\" => sub {$suppress_from = 0},\n \t\t    \"suppress-cc=s\" => \\@suppress_cc,\n \t\t    \"signed-off-cc|signed-off-by-cc!\" => \\$signed_off_by_cc,\n-\t\t    \"no-signed-off-cc|no-signed-off-by-cc\" => sub {$signed_off_by_cc = 0},\n-\t\t    \"cc-cover|cc-cover!\" => \\$cover_cc,\n-\t\t    \"no-cc-cover\" => sub {$cover_cc = 0},\n-\t\t    \"to-cover|to-cover!\" => \\$cover_to,\n-\t\t    \"no-to-cover\" => sub {$cover_to = 0},\n+\t\t    \"cc-cover!\" => \\$cover_cc,\n+\t\t    \"to-cover!\" => \\$cover_to,\n \t\t    \"confirm=s\" => \\$confirm,\n \t\t    \"dry-run\" => \\$dry_run,\n \t\t    \"envelope-sender=s\" => \\$envelope_sender,\n \t\t    \"thread!\" => \\$thread,\n-\t\t    \"no-thread\" => sub {$thread = 0},\n \t\t    \"validate!\" => \\$validate,\n-\t\t    \"no-validate\" => sub {$validate = 0},\n \t\t    \"transfer-encoding=s\" => \\$target_xfer_encoding,\n \t\t    \"format-patch!\" => \\$format_patch,\n-\t\t    \"no-format-patch\" => sub {$format_patch = 0},\n \t\t    \"8bit-encoding=s\" => \\$auto_8bit_encoding,\n \t\t    \"compose-encoding=s\" => \\$compose_encoding,\n \t\t    \"force\" => \\$force,\n \t\t    \"xmailer!\" => \\$use_xmailer,\n-\t\t    \"no-xmailer\" => sub {$use_xmailer = 0},\n \t\t    \"batch-size=i\" => \\$batch_size,\n \t\t    \"relogin-delay=i\" => \\$relogin_delay,\n \t\t    \"git-completion-helper\" => \\$git_completion_helper,\n-- \n2.42.1\n\n"},{"id":"485141","messageId":"ZWFaZcgzwEP13geI@archie.me","threadId":"60553","inReplyTo":"20231124103932.31ca7688@pc09","subject":"Re: Fix git-send-email.perl w.r.t. recent Getopt::Long update","fromName":"Bagas Sanjaya","fromEmail":"bagasdotme@gmail.com","sentAt":"2023-11-25T02:22:29Z","receivedAt":"2023-11-25T02:22:34Z","isPatch":false,"sender":{"key":"bagasdotme@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40219486?v=4"},"body":"On Fri, Nov 24, 2023 at 10:39:32AM +0100, H.Merijn Brand wrote:\n> Patch attached\n\nDo not send patches as attachments; send them inline instead. See\nDocumentation/SubmittingPatches for more info (hint: send patches\nwith git-send-email(1)).\n\nThanks.\n\n-- \nAn old man doll... just what I always wanted! - Clara\n"},{"id":"485142","messageId":"20231125104211.5b7fe0be@pc09","threadId":"60553","inReplyTo":"ZWFaZcgzwEP13geI@archie.me","subject":"Re: Fix git-send-email.perl w.r.t. recent Getopt::Long update","fromName":"H.Merijn Brand","fromEmail":"linux@tux.freedom.nl","sentAt":"2023-11-25T09:45:22Z","receivedAt":"2023-11-25T09:45:52Z","isPatch":false,"sender":{"key":"linux@tux.freedom.nl","avatar":"https://gravatar.com/avatar/2c89aaef31466fa10e55c481a4b875828a741dd42413cbcf61aa1e6c0cbfa3bd?d=mp&s=160"},"body":"On Sat, 25 Nov 2023 09:22:29 +0700, Bagas Sanjaya <bagasdotme@gmail.com> wrote:\n\n> On Fri, Nov 24, 2023 at 10:39:32AM +0100, H.Merijn Brand wrote:\n> > Patch attached  \n> \n> Do not send patches as attachments; send them inline instead. See\n> Documentation/SubmittingPatches for more info (hint: send patches\n> with git-send-email(1)).\n\nAs I am used to PR's by now on all OSS projects I am involved in, or\nuse git commits or merges directly on the repo, I *never* use\nformat-patch and/or send-email.\n\nThese docs - yes I read them - do not offer a concise cut-n-paste\nexample for people like me. In order to have my relative simple patch\nsubmitted (I already had the PR ready, but that came with a huge\nwarning that PR's are not accepted) I did it the way I did it. Now I\nneed to read and learn two new commands> I don't think that is very\nuser-friendly, but that might be just me.\n\nIronically, this patch is about the mail part of git.\n\nI suggest adding a small example like\n\n # Create the patch basics\n $ git format-patch --cover-letter -M origin/master -o outgoing\n # Fix the subject\n $ $VISUAL outgoing/0000-cover-letter.patch\n # Send the mail\n $ git send-email --to=git@vger.kernel.org outgoing/*\n\n> Thanks.\n\n-- \nH.Merijn Brand  https://tux.nl   Perl Monger   http://amsterdam.pm.org/\nusing perl5.00307 .. 5.37        porting perl5 on HP-UX, AIX, and Linux\nhttps://tux.nl/email.html http://qa.perl.org https://www.test-smoke.org\n                           \n"},{"id":"485146","messageId":"449722c7e6ab8bddae44133f2a97491d@manjaro.org","threadId":"60553","inReplyTo":"20231125104211.5b7fe0be@pc09","subject":"Re: Fix git-send-email.perl w.r.t. recent Getopt::Long update","fromName":"Dragan Simic","fromEmail":"dsimic@manjaro.org","sentAt":"2023-11-25T12:28:13Z","receivedAt":"2023-11-25T12:28:16Z","isPatch":false,"sender":{"key":"dsimic@manjaro.org","avatar":null},"body":"On 2023-11-25 10:45, H.Merijn Brand wrote:\n> As I am used to PR's by now on all OSS projects I am involved in, or\n> use git commits or merges directly on the repo, I *never* use\n> format-patch and/or send-email.\n\nActually, using email to send patches is quite neat, IMHO, once you get \nhold of it.\n\n> These docs - yes I read them - do not offer a concise cut-n-paste\n> example for people like me. In order to have my relative simple patch\n> submitted (I already had the PR ready, but that came with a huge\n> warning that PR's are not accepted) I did it the way I did it. Now I\n> need to read and learn two new commands> I don't think that is very\n> user-friendly, but that might be just me.\n> \n> Ironically, this patch is about the mail part of git.\n> \n> I suggest adding a small example like\n> \n>  # Create the patch basics\n>  $ git format-patch --cover-letter -M origin/master -o outgoing\n>  # Fix the subject\n>  $ $VISUAL outgoing/0000-cover-letter.patch\n>  # Send the mail\n>  $ git send-email --to=git@vger.kernel.org outgoing/*\n\nPlease note that a cover letter isn't needed unless you're sending a \npatch series, i.e. unless you're generating and sending more than a \nsingle patch at once.  Also, fixing the subject line inside the patch \nfiles generated by git-format-patch shouldn't be needed in most cases, \nand commit summaries should be adjusted/rebased instead, if needed.\n"},{"id":"485162","messageId":"xmqqzfz03tbn.fsf@gitster.g","threadId":"60553","inReplyTo":"20231124103932.31ca7688@pc09","subject":"Re: Fix git-send-email.perl w.r.t. recent Getopt::Long update","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-11-27T00:58:52Z","receivedAt":"2023-11-27T00:58:57Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"H.Merijn Brand\" <linux@tux.freedom.nl> writes:\n\n> From the Getopt::Long changes:\n> ```\n> Changes in version 2.55\n> -----------------------\n> * Fix long standing bug that duplicate options were not detected when\n>   the options differ in case while ignore_case is in effect.\n>   This will now yield a warning and become a fatal error in a future\n>   release.\n> ```\n>\n> Current version is 2.57\n\nThis patch looks like duplicate of\n\n  https://lore.kernel.org/git/20231116193014.470420-1-tmz@pobox.com/\n\nperhaps independently discovered and worked on.  Thanks for caring.\n\nOne downside of unconditional upgrade of the call is, of course,\nthat it would no longer work for those with older Getopt::Long that\ndid not support the \"!\" suffix.  Fortunately, Getopt::Long 2.33\nstarted shipping with Perl 5.8.1 that is more than 20 years old, so\nwith the series we accepted, we also have a change to bump the\nrequired version of Perl from 5.8.0 to 5.8.1 to make it clear that\nit is deliberate that we drop the support for anything older at the\nsame time.\n\n"},{"id":"485165","messageId":"20231127093810.2092fe1d@pc09","threadId":"60553","inReplyTo":"xmqqzfz03tbn.fsf@gitster.g","subject":"Re: Fix git-send-email.perl w.r.t. recent Getopt::Long update","fromName":"H.Merijn Brand","fromEmail":"linux@tux.freedom.nl","sentAt":"2023-11-27T08:38:10Z","receivedAt":"2023-11-27T08:47:05Z","isPatch":false,"sender":{"key":"linux@tux.freedom.nl","avatar":"https://gravatar.com/avatar/2c89aaef31466fa10e55c481a4b875828a741dd42413cbcf61aa1e6c0cbfa3bd?d=mp&s=160"},"body":"On Mon, 27 Nov 2023 09:58:52 +0900, Junio C Hamano <gitster@pobox.com> wrote:\n\n> \"H.Merijn Brand\" <linux@tux.freedom.nl> writes:\n> \n> > From the Getopt::Long changes:\n> > ```\n> > Changes in version 2.55\n> > -----------------------\n> > * Fix long standing bug that duplicate options were not detected when\n> >   the options differ in case while ignore_case is in effect.\n> >   This will now yield a warning and become a fatal error in a future\n> >   release.\n> > ```\n> >\n> > Current version is 2.57  \n> \n> This patch looks like duplicate of\n> \n>   https://lore.kernel.org/git/20231116193014.470420-1-tmz@pobox.com/\n> \n> perhaps independently discovered and worked on.  Thanks for caring.\n> \n> One downside of unconditional upgrade of the call is, of course,\n> that it would no longer work for those with older Getopt::Long that\n> did not support the \"!\" suffix.  Fortunately, Getopt::Long 2.33\n> started shipping with Perl 5.8.1 that is more than 20 years old, so\n> with the series we accepted, we also have a change to bump the\n> required version of Perl from 5.8.0 to 5.8.1 to make it clear that\n> it is deliberate that we drop the support for anything older at the\n> same time.\n\nThe is a no-issue ...\n\nJust the 'use Getopt::Long' is enough to guarantee a working version:\n\nThe '!' was already implemented in version 2.10 (April 1997):\n--8<---\n=item !\n\nOption does not take an argument and may be negated, i.e. prefixed by\n\"no\". E.g. \"foo!\" will allow B<--foo> (with value 1) and B<-nofoo>\n(with value 0).\nThe option variable will be set to 1, or 0 if negated.\n-->8---\n\nLooking at the ChangeLog,  a reliable behavior of '!' was available\nsince version 2.22 (march 2000):\n--8<---\nChanges in version 2.22\n-----------------------\n\n* Fixes a bug in the combination of aliases and negation.\n\n  Old:  \"foo|bar!\" allowed negation on foo, but not on bar.\n  New:  \"foo|bar!\" allows negation on foo and bar.\n\n  Caveat: \"foo|f!\", with bundling, issues the warning that negation on\n  a short option is ignored. To obtain the desired behaviour, use\n\n        \"foo!\" => \\$opt_foo, \"f\" => \\$opt_foo\n  or\n        \"foo|f\" => \\$opt_foo, \"nofoo\" => sub { $opt_foo = 0 }\n\n  Remember that this is _only_ required when bundling is in effect.\n-->8---\n\n-- \nH.Merijn Brand  https://tux.nl   Perl Monger   http://amsterdam.pm.org/\nusing perl5.00307 .. 5.37        porting perl5 on HP-UX, AIX, and Linux\nhttps://tux.nl/email.html http://qa.perl.org https://www.test-smoke.org\n                           \n"},{"id":"485181","messageId":"20231127213843.GC87495@coredump.intra.peff.net","threadId":"60553","inReplyTo":"20231125104211.5b7fe0be@pc09","subject":"Re: Fix git-send-email.perl w.r.t. recent Getopt::Long update","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2023-11-27T21:38:43Z","receivedAt":"2023-11-27T21:38:44Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Nov 25, 2023 at 10:45:22AM +0100, H.Merijn Brand wrote:\n\n> As I am used to PR's by now on all OSS projects I am involved in, or\n> use git commits or merges directly on the repo, I *never* use\n> format-patch and/or send-email.\n> \n> These docs - yes I read them - do not offer a concise cut-n-paste\n> example for people like me. In order to have my relative simple patch\n> submitted (I already had the PR ready, but that came with a huge\n> warning that PR's are not accepted) I did it the way I did it. Now I\n> need to read and learn two new commands> I don't think that is very\n> user-friendly, but that might be just me.\n\nThese days you can use GitGitGadget to submit a PR to the mailing list:\n\n  https://gitgitgadget.github.io/\n\nThe PR template mentions this, as well as the \"about\" text for git/git,\nbut I won't be surprised if there are other spots that should be updated\nto mention it. If you found a message that would benefit from mentioning\nit, let us know so we can update it.\n\nThanks.\n\n-Peff\n"},{"id":"485186","messageId":"ZWVLRIfARhRhz-7L@pobox.com","threadId":"60553","inReplyTo":"20231127093810.2092fe1d@pc09","subject":"Re: Fix git-send-email.perl w.r.t. recent Getopt::Long update","fromName":"Todd Zullinger","fromEmail":"tmz@pobox.com","sentAt":"2023-11-28T02:07:00Z","receivedAt":"2023-11-28T02:07:08Z","isPatch":false,"sender":{"key":"tmz@pobox.com","avatar":"https://avatars.githubusercontent.com/u/806319?v=4"},"body":"Hi,\n\nH.Merijn Brand wrote:\n> On Mon, 27 Nov 2023 09:58:52 +0900, Junio C Hamano <gitster@pobox.com> wrote:\n>> One downside of unconditional upgrade of the call is, of course,\n>> that it would no longer work for those with older Getopt::Long that\n>> did not support the \"!\" suffix.  Fortunately, Getopt::Long 2.33\n>> started shipping with Perl 5.8.1 that is more than 20 years old, so\n>> with the series we accepted, we also have a change to bump the\n>> required version of Perl from 5.8.0 to 5.8.1 to make it clear that\n>> it is deliberate that we drop the support for anything older at the\n>> same time.\n> \n> The is a no-issue ...\n> \n> Just the 'use Getopt::Long' is enough to guarantee a working version:\n> \n> The '!' was already implemented in version 2.10 (April 1997):\n> --8<---\n> =item !\n> \n> Option does not take an argument and may be negated, i.e. prefixed by\n> \"no\". E.g. \"foo!\" will allow B<--foo> (with value 1) and B<-nofoo>\n> (with value 0).\n> The option variable will be set to 1, or 0 if negated.\n> -->8---\n\nThe real issue is the lack of support for the '--no-' prefix\nwhen used with the '!' parameter.  The '--no-' form is what\nhas always been documented by git-send-email(1).  It was not\nsupported until Getopt::Long 2.33, included in perl 5.8.1.\n\nPrior, 'foo!' provided --foo and --nofoo but not --no-foo.\n\nBut as Junio said, we can accept requiring a perl which was\nreleased sometime in the past 2 decades in order to run the\nmost recent git release. ;)\n\nThanks for noticing this and sending a patch!\n\n-- \nTodd\n"}]}