diff options
author | Jeff King <peff@peff.net> | 2012-11-09 12:50:45 -0500 |
---|---|---|
committer | Jeff King <peff@peff.net> | 2012-11-09 12:50:45 -0500 |
commit | d9253f2bc8b17249a433494a54dbe0d22ae8c5d0 (patch) | |
tree | a592942b52407478729a250c9f5e8c2f545e35b7 | |
parent | 3aedff6b60a29f42bc168c45e42cb1da88ecfc41 (diff) | |
parent | 2f65494d84fa9d250595e6c02d9e977c512cc09c (diff) | |
download | git-d9253f2bc8b17249a433494a54dbe0d22ae8c5d0.tar.gz |
Merge branch 'fc/completion-send-email-with-format-patch'
* fc/completion-send-email-with-format-patch:
completion: add format-patch options to send-email
-rw-r--r-- | contrib/completion/git-completion.bash | 35 | ||||
-rwxr-xr-x | t/t9902-completion.sh | 5 |
2 files changed, 23 insertions, 17 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index be800e09bd..bc0657a224 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1116,6 +1116,14 @@ _git_fetch () __git_complete_remote_or_refspec } +__git_format_patch_options=" + --stdout --attach --no-attach --thread --thread= --output-directory + --numbered --start-number --numbered-files --keep-subject --signoff + --signature --no-signature --in-reply-to= --cc= --full-index --binary + --not --all --cover-letter --no-prefix --src-prefix= --dst-prefix= + --inline --suffix= --ignore-if-in-upstream --subject-prefix= +" + _git_format_patch () { case "$cur" in @@ -1126,21 +1134,7 @@ _git_format_patch () return ;; --*) - __gitcomp " - --stdout --attach --no-attach --thread --thread= - --output-directory - --numbered --start-number - --numbered-files - --keep-subject - --signoff --signature --no-signature - --in-reply-to= --cc= - --full-index --binary - --not --all - --cover-letter - --no-prefix --src-prefix= --dst-prefix= - --inline --suffix= --ignore-if-in-upstream - --subject-prefix= - " + __gitcomp "$__git_format_patch_options" return ;; esac @@ -1554,6 +1548,12 @@ _git_send_email () __gitcomp "ssl tls" "" "${cur##--smtp-encryption=}" return ;; + --thread=*) + __gitcomp " + deep shallow + " "" "${cur##--thread=}" + return + ;; --*) __gitcomp "--annotate --bcc --cc --cc-cmd --chain-reply-to --compose --confirm= --dry-run --envelope-sender @@ -1563,11 +1563,12 @@ _git_send_email () --signed-off-by-cc --smtp-pass --smtp-server --smtp-server-port --smtp-encryption= --smtp-user --subject --suppress-cc= --suppress-from --thread --to - --validate --no-validate" + --validate --no-validate + $__git_format_patch_options" return ;; esac - COMPREPLY=() + __git_complete_revlist } _git_stage () diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index cbd0fb66f9..8fa025f9d4 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -288,4 +288,9 @@ test_expect_failure 'complete tree filename with metacharacters' ' EOF ' +test_expect_success 'send-email' ' + test_completion "git send-email --cov" "--cover-letter " && + test_completion "git send-email ma" "master " +' + test_done |