diff options
author | Britton Leo Kerin <britton.kerin@gmail.com> | 2024-02-06 22:50:48 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-02-07 00:11:46 +0100 |
commit | d8e08f0717c17b2ee629c50844c34adc83575ad0 (patch) | |
tree | 5773cba15ccf3bc086d51aa6a8f733d3ae5aab67 /t/t9902-completion.sh | |
parent | completion: bisect: complete log opts for visualize subcommand (diff) | |
download | git-d8e08f0717c17b2ee629c50844c34adc83575ad0.tar.xz git-d8e08f0717c17b2ee629c50844c34adc83575ad0.zip |
completion: bisect: recognize but do not complete view subcommand
The "view" alias for the visualize subcommand is neither completed nor
recognized. It's undesirable to complete it because it's first letters
are the same as for visualize, making completion less rather than more
efficient without adding much in the way of interface discovery.
However, it needs to be recognized in order to enable log option
completion for it.
Recognize but do not complete the view command by creating and using
separate lists of completable_subcommands and all_subcommands. Add
tests.
Signed-off-by: Britton Leo Kerin <britton.kerin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rwxr-xr-x | t/t9902-completion.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index b989388e7e..70557eb684 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -1376,6 +1376,30 @@ test_expect_success 'git-bisect - git-log options to visualize subcommand are ca ) ' +test_expect_success 'git-bisect - view subcommand is not a candidate' ' + ( + cd git-bisect && + test_completion "git bisect vi" <<-\EOF + visualize Z + EOF + ) +' + +test_expect_success 'git-bisect - existing view subcommand is recognized and enables completion of git-log options' ' + ( + cd git-bisect && + # The completion used for git-log and here does not complete + # every git-log option, so rather than hope to stay in sync + # with exactly what it does we will just spot-test here. + test_completion "git bisect view --sta" <<-\EOF && + --stat Z + EOF + test_completion "git bisect view --summar" <<-\EOF + --summary Z + EOF + ) +' + test_expect_success 'git checkout - completes refs and unique remote branches for DWIM' ' test_completion "git checkout " <<-\EOF HEAD Z |