]> git.ipfire.org Git - thirdparty/git.git/commit - t/t9902-completion.sh
completion: let git provide the completable command list
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sun, 20 May 2018 18:40:04 +0000 (20:40 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 21 May 2018 04:23:14 +0000 (13:23 +0900)
commit84a971310656b7f553b48ca30bcd8936c95b00c9
tree851d0bc2196c8ca424b11eb760965ec77242a0e5
parentfe902f2cefee4d4607c43efe8b5750f346199c43
completion: let git provide the completable command list

Instead of maintaining a separate list of command classification,
which often could go out of date, let's centralize the information
back in git.

While the function in git-completion.bash implies "list porcelain
commands", that's not exactly what it does. It gets all commands (aka
--list-cmds=main,others) then exclude certain non-porcelain ones. We
could almost recreate this list two lists list-mainporcelain and
others. The non-porcelain-but-included-anyway is added by the third
category list-complete.

Note that the current completion script incorrectly classifies
filter-branch as porcelain and t9902 tests this behavior. We keep it
this way in t9902 because this test does not really care which
particular command is porcelain or plumbing, they're just names.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
command-list.txt
contrib/completion/git-completion.bash
t/t9902-completion.sh