From: Junio C Hamano Date: Wed, 20 Sep 2023 18:46:55 GMT Subject: Re: [PATCH] completion: loosen and document the requirement around completing alias Message-ID: In-Reply-To: Junio C Hamano writes: > * We've discussed this when we reviewed the topic that just hit > 'master'. Before we forget... > > contrib/completion/git-completion.bash | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) And here is an obligatory "test" update I will squash into the main patch. The new ones copy a canonical ": git ; ..." test and remove 'git' and also the space before the semicolon. diff --git c/t/t9902-completion.sh w/t/t9902-completion.sh index 47e20fb8b1..a7c3b4eb63 100755 --- c/t/t9902-completion.sh +++ w/t/t9902-completion.sh @@ -2464,6 +2464,24 @@ test_expect_success 'completion used completion for alias: !f() { : git completion for alias: !f() { : ; ... }' ' + test_config alias.co "!f() { : checkout ; if ... } f" && + test_completion "git co m" <<-\EOF + main Z + mybranch Z + mytag Z + EOF +' + +test_expect_success 'completion used completion for alias: !f() { : ; ... }' ' + test_config alias.co "!f() { : checkout; if ... } f" && + test_completion "git co m" <<-\EOF + main Z + mybranch Z + mytag Z + EOF +' + test_expect_success 'completion without explicit _git_xxx function' ' test_completion "git version --" <<-\EOF --build-options Z