{"thread":{"id":"56203","subject":"[PATCH 0/3] git-send-email options and completion improvements","startedAt":"2021-08-02T20:50:41Z","lastAt":"2021-08-02T20:51:31Z","messageCount":4,"participants":["Thiago Perrotta"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"431755","messageId":"20210802204953.229867-1-tbperrotta@gmail.com","threadId":"56203","inReplyTo":null,"subject":"[PATCH 0/3] git-send-email options and completion improvements","fromName":"Thiago Perrotta","fromEmail":"tbperrotta@gmail.com","sentAt":"2021-08-02T20:49:50Z","receivedAt":"2021-08-02T20:50:41Z","isPatch":true,"sender":{"key":"tbperrotta@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2840106?v=4"},"body":"This patch makes git-send-email completion (bash, zsh) uniform,\ncentralizing the completion options on git-send-email.perl instead of\ngit-completion.bash\n\nThe overall result is that git send-email --git-completion-helper now\nproperly emits send-email specific options. Previously, it was only\nemitting format-patch flags.\n\nAdditionally there's a sentence in git-send-email(1) to explicitly\nmention that format-patch options can also be passed to it. Currently\nit's not obvious this is the case from the man page alone.\n\nThiago Perrotta (3):\n  Print newline for git-send-email --git-completion-helper.\n  Move bash git-send-email completions to original script.\n  Expand git-send-email docs to mention format-patch options.\n\n Documentation/git-send-email.txt       |  2 ++\n contrib/completion/git-completion.bash | 11 +-------\n git-send-email.perl                    | 35 ++++++++++++++++++++++++++\n t/t9902-completion.sh                  |  3 +++\n 4 files changed, 41 insertions(+), 10 deletions(-)\n\n-- \n2.32.0\n\n"},{"id":"431756","messageId":"20210802204953.229867-2-tbperrotta@gmail.com","threadId":"56203","inReplyTo":"20210802204953.229867-1-tbperrotta@gmail.com","subject":"[PATCH 1/3] Print newline for git-send-email --git-completion-helper.","fromName":"Thiago Perrotta","fromEmail":"tbperrotta@gmail.com","sentAt":"2021-08-02T20:49:51Z","receivedAt":"2021-08-02T20:51:23Z","isPatch":true,"sender":{"key":"tbperrotta@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2840106?v=4"},"body":"Rationale: All git built-in commands print a newline upon upon git <cmd>\n--git-completion-helper. Therefore git-send-email should follow suit for\nconsistency.\n\nSigned-off-by: Thiago Perrotta <tbperrotta@gmail.com>\n---\n git-send-email.perl | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex e65d969..e991bf3 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -115,6 +115,7 @@ sub usage {\n \n sub completion_helper {\n     print Git::command('format-patch', '--git-completion-helper');\n+    print \"\\n\";\n     exit(0);\n }\n \n-- \n2.32.0\n\n"},{"id":"431757","messageId":"20210802204953.229867-3-tbperrotta@gmail.com","threadId":"56203","inReplyTo":"20210802204953.229867-1-tbperrotta@gmail.com","subject":"[PATCH 2/3] Move bash git-send-email completions to original script.","fromName":"Thiago Perrotta","fromEmail":"tbperrotta@gmail.com","sentAt":"2021-08-02T20:49:52Z","receivedAt":"2021-08-02T20:51:28Z","isPatch":true,"sender":{"key":"tbperrotta@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2840106?v=4"},"body":"As far as bash-completion is concerned, this refactoring is a no-op.\n\nHowever, this improves `git send-email --git-completion-helper`, which\nwas previously printing only `git format-patch` flags, to print\nsend-email specific flags as well.\n\nAdd a completion test for --validate which is a send-email specific\noption.\n\nSigned-off-by: Thiago Perrotta <tbperrotta@gmail.com>\n---\n contrib/completion/git-completion.bash | 11 +--------\n git-send-email.perl                    | 34 ++++++++++++++++++++++++++\n t/t9902-completion.sh                  |  3 +++\n 3 files changed, 38 insertions(+), 10 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 4bdd27d..1b73a4d 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -2359,16 +2359,7 @@ _git_send_email ()\n \t\treturn\n \t\t;;\n \t--*)\n-\t\t__gitcomp_builtin send-email \"--annotate --bcc --cc --cc-cmd --chain-reply-to\n-\t\t\t--compose --confirm= --dry-run --envelope-sender\n-\t\t\t--from --identity\n-\t\t\t--in-reply-to --no-chain-reply-to --no-signed-off-by-cc\n-\t\t\t--no-suppress-from --no-thread --quiet --reply-to\n-\t\t\t--signed-off-by-cc --smtp-pass --smtp-server\n-\t\t\t--smtp-server-port --smtp-encryption= --smtp-user\n-\t\t\t--subject --suppress-cc= --suppress-from --thread --to\n-\t\t\t--validate --no-validate\n-\t\t\t$__git_format_patch_extra_options\"\n+\t\t__gitcomp_builtin send-email \"$__git_format_patch_extra_options\"\n \t\treturn\n \t\t;;\n \tesac\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex e991bf3..eec78d7 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -114,6 +114,40 @@ sub usage {\n }\n \n sub completion_helper {\n+    my @send_email_flags = qw/\n+    --annotate\n+    --bcc\n+    --cc\n+    --cc-cmd\n+    --chain-reply-to\n+    --compose\n+    --confirm=\n+    --dry-run\n+    --envelope-sender\n+    --from\n+    --identity\n+    --in-reply-to\n+    --no-chain-reply-to\n+    --no-signed-off-by-cc\n+    --no-suppress-from\n+    --no-thread\n+    --quiet\n+    --reply-to\n+    --signed-off-by-cc\n+    --smtp-pass\n+    --smtp-server\n+    --smtp-server-port\n+    --smtp-encryption=\n+    --smtp-user\n+    --subject\n+    --suppress-cc=\n+    --suppress-from\n+    --thread\n+    --to\n+    --validate\n+    --no-validate\n+    /;\n+    print \"@send_email_flags\";\n     print Git::command('format-patch', '--git-completion-helper');\n     print \"\\n\";\n     exit(0);\ndiff --git a/t/t9902-completion.sh b/t/t9902-completion.sh\nindex 1157393..a4faf64 100755\n--- a/t/t9902-completion.sh\n+++ b/t/t9902-completion.sh\n@@ -2139,6 +2139,9 @@ test_expect_success PERL 'send-email' '\n \t--cover-from-description=Z\n \t--cover-letter Z\n \tEOF\n+\ttest_completion \"git send-email --val\" <<-\\EOF &&\n+\t--validate Z\n+\tEOF\n \ttest_completion \"git send-email ma\" \"main \"\n '\n \n-- \n2.32.0\n\n"},{"id":"431758","messageId":"20210802204953.229867-4-tbperrotta@gmail.com","threadId":"56203","inReplyTo":"20210802204953.229867-1-tbperrotta@gmail.com","subject":"[PATCH 3/3] Expand git-send-email docs to mention format-patch options.","fromName":"Thiago Perrotta","fromEmail":"tbperrotta@gmail.com","sentAt":"2021-08-02T20:49:53Z","receivedAt":"2021-08-02T20:51:31Z","isPatch":true,"sender":{"key":"tbperrotta@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2840106?v=4"},"body":"Currently git-send-email(1) does not make it explicit format-patch\noptions are accepted.\n\nSigned-off-by: Thiago Perrotta <tbperrotta@gmail.com>\n---\n Documentation/git-send-email.txt | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex 3db4eab..05dd8de 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -42,6 +42,8 @@ and the \"Subject:\" of the message as the second line.\n OPTIONS\n -------\n \n+Options from linkgit:git-format-patch[1] are also accepted.\n+\n Composing\n ~~~~~~~~~\n \n-- \n2.32.0\n\n"}]}