Skip to content

Commit 2f65494

Browse files
felipecgitster
authored andcommitted
completion: add format-patch options to send-email
Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 42e55a5 commit 2f65494

File tree

2 files changed

+23
-17
lines changed

2 files changed

+23
-17
lines changed

contrib/completion/git-completion.bash

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,14 @@ _git_fetch ()
11161116
__git_complete_remote_or_refspec
11171117
}
11181118

1119+
__git_format_patch_options="
1120+
--stdout --attach --no-attach --thread --thread= --output-directory
1121+
--numbered --start-number --numbered-files --keep-subject --signoff
1122+
--signature --no-signature --in-reply-to= --cc= --full-index --binary
1123+
--not --all --cover-letter --no-prefix --src-prefix= --dst-prefix=
1124+
--inline --suffix= --ignore-if-in-upstream --subject-prefix=
1125+
"
1126+
11191127
_git_format_patch ()
11201128
{
11211129
case "$cur" in
@@ -1126,21 +1134,7 @@ _git_format_patch ()
11261134
return
11271135
;;
11281136
--*)
1129-
__gitcomp "
1130-
--stdout --attach --no-attach --thread --thread=
1131-
--output-directory
1132-
--numbered --start-number
1133-
--numbered-files
1134-
--keep-subject
1135-
--signoff --signature --no-signature
1136-
--in-reply-to= --cc=
1137-
--full-index --binary
1138-
--not --all
1139-
--cover-letter
1140-
--no-prefix --src-prefix= --dst-prefix=
1141-
--inline --suffix= --ignore-if-in-upstream
1142-
--subject-prefix=
1143-
"
1137+
__gitcomp "$__git_format_patch_options"
11441138
return
11451139
;;
11461140
esac
@@ -1554,6 +1548,12 @@ _git_send_email ()
15541548
__gitcomp "ssl tls" "" "${cur##--smtp-encryption=}"
15551549
return
15561550
;;
1551+
--thread=*)
1552+
__gitcomp "
1553+
deep shallow
1554+
" "" "${cur##--thread=}"
1555+
return
1556+
;;
15571557
--*)
15581558
__gitcomp "--annotate --bcc --cc --cc-cmd --chain-reply-to
15591559
--compose --confirm= --dry-run --envelope-sender
@@ -1563,11 +1563,12 @@ _git_send_email ()
15631563
--signed-off-by-cc --smtp-pass --smtp-server
15641564
--smtp-server-port --smtp-encryption= --smtp-user
15651565
--subject --suppress-cc= --suppress-from --thread --to
1566-
--validate --no-validate"
1566+
--validate --no-validate
1567+
$__git_format_patch_options"
15671568
return
15681569
;;
15691570
esac
1570-
COMPREPLY=()
1571+
__git_complete_revlist
15711572
}
15721573

15731574
_git_stage ()

t/t9902-completion.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,4 +288,9 @@ test_expect_failure 'complete tree filename with metacharacters' '
288288
EOF
289289
'
290290

291+
test_expect_success 'send-email' '
292+
test_completion "git send-email --cov" "--cover-letter " &&
293+
test_completion "git send-email ma" "master "
294+
'
295+
291296
test_done

0 commit comments

Comments
 (0)