{"thread":{"id":"59504","subject":"[PATCH] send-email: show --no options correctly","startedAt":"2023-03-31T01:54:03Z","lastAt":"2023-03-31T01:54:03Z","messageCount":1,"participants":["Felipe Contreras"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"474495","messageId":"20230331015357.154459-1-felipe.contreras@gmail.com","threadId":"59504","inReplyTo":null,"subject":"[PATCH] send-email: show --no options correctly","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-03-31T01:53:57Z","receivedAt":"2023-03-31T01:54:03Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"All of the --no options need to be after the `--`, otherwise the\ncompletion will show them initially.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n git-send-email.perl | 7 ++++---\n 1 file changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 07f2a0cbea..f0d80baa01 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -142,9 +142,10 @@ sub completion_helper {\n \n \tmy @format_patch_opts = split(/ /, Git::command('format-patch', '--git-completion-helper'));\n \tmy @opts = (@send_email_opts, @format_patch_opts);\n-\t@opts = uniq (grep !/^$/, @opts);\n-\t# There's an implicit '\\n' here already, no need to add an explicit one.\n-\tprint \"@opts\";\n+\t@opts = uniq (grep !/^(--|)$/, @opts);\n+\tmy @pos_opts = grep(!/^--no/, @opts);\n+\tmy @neg_opts = grep(/^--no/, @opts);\n+\tprint \"@pos_opts -- @neg_opts\";\n \texit(0);\n }\n \n-- \n2.40.0.133.g8a4477c8d7.dirty\n\n"}]}