{"thread":{"id":"31829","subject":"[PATCH v2] completion: add format-patch options to send-email","startedAt":"2012-10-16T00:21:50Z","lastAt":"2012-10-16T00:21:50Z","messageCount":1,"participants":["Felipe Contreras"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"201299","messageId":"1350346910-29853-1-git-send-email-felipe.contreras@gmail.com","threadId":"31829","inReplyTo":null,"subject":"[PATCH v2] completion: add format-patch options to send-email","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-10-16T00:21:50Z","receivedAt":"2012-10-16T00:21:50Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n\nv2: Fix comments by SZEDER Gabor\n\n contrib/completion/git-completion.bash | 35 +++++++++++++++++-----------------\n t/t9902-completion.sh                  |  5 +++++\n 2 files changed, 23 insertions(+), 17 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex be800e0..bc0657a 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1116,6 +1116,14 @@ _git_fetch ()\n \t__git_complete_remote_or_refspec\n }\n \n+__git_format_patch_options=\"\n+\t--stdout --attach --no-attach --thread --thread= --output-directory\n+\t--numbered --start-number --numbered-files --keep-subject --signoff\n+\t--signature --no-signature --in-reply-to= --cc= --full-index --binary\n+\t--not --all --cover-letter --no-prefix --src-prefix= --dst-prefix=\n+\t--inline --suffix= --ignore-if-in-upstream --subject-prefix=\n+\"\n+\n _git_format_patch ()\n {\n \tcase \"$cur\" in\n@@ -1126,21 +1134,7 @@ _git_format_patch ()\n \t\treturn\n \t\t;;\n \t--*)\n-\t\t__gitcomp \"\n-\t\t\t--stdout --attach --no-attach --thread --thread=\n-\t\t\t--output-directory\n-\t\t\t--numbered --start-number\n-\t\t\t--numbered-files\n-\t\t\t--keep-subject\n-\t\t\t--signoff --signature --no-signature\n-\t\t\t--in-reply-to= --cc=\n-\t\t\t--full-index --binary\n-\t\t\t--not --all\n-\t\t\t--cover-letter\n-\t\t\t--no-prefix --src-prefix= --dst-prefix=\n-\t\t\t--inline --suffix= --ignore-if-in-upstream\n-\t\t\t--subject-prefix=\n-\t\t\t\"\n+\t\t__gitcomp \"$__git_format_patch_options\"\n \t\treturn\n \t\t;;\n \tesac\n@@ -1554,6 +1548,12 @@ _git_send_email ()\n \t\t__gitcomp \"ssl tls\" \"\" \"${cur##--smtp-encryption=}\"\n \t\treturn\n \t\t;;\n+\t--thread=*)\n+\t\t__gitcomp \"\n+\t\t\tdeep shallow\n+\t\t\t\" \"\" \"${cur##--thread=}\"\n+\t\treturn\n+\t\t;;\n \t--*)\n \t\t__gitcomp \"--annotate --bcc --cc --cc-cmd --chain-reply-to\n \t\t\t--compose --confirm= --dry-run --envelope-sender\n@@ -1563,11 +1563,12 @@ _git_send_email ()\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--validate --no-validate\n+\t\t\t$__git_format_patch_options\"\n \t\treturn\n \t\t;;\n \tesac\n-\tCOMPREPLY=()\n+\t__git_complete_revlist\n }\n \n _git_stage ()\ndiff --git a/t/t9902-completion.sh b/t/t9902-completion.sh\nindex cbd0fb6..8fa025f 100755\n--- a/t/t9902-completion.sh\n+++ b/t/t9902-completion.sh\n@@ -288,4 +288,9 @@ test_expect_failure 'complete tree filename with metacharacters' '\n \tEOF\n '\n \n+test_expect_success 'send-email' '\n+\ttest_completion \"git send-email --cov\" \"--cover-letter \" &&\n+\ttest_completion \"git send-email ma\" \"master \"\n+'\n+\n test_done\n-- \n1.7.12.1\n"}]}