{"thread":{"id":"44803","subject":"[PATCH] completion: complete git submodule subcommands","startedAt":"2017-01-02T08:58:18Z","lastAt":"2017-01-02T08:58:18Z","messageCount":1,"participants":["Denton Liu"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"308608","messageId":"20170102085810.GA10331@arch-attack.localdomain","threadId":"44803","inReplyTo":null,"subject":"[PATCH] completion: complete git submodule subcommands","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2017-01-02T08:58:10Z","receivedAt":"2017-01-02T08:58:18Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"Allow git submodule subcommands to be completed. This allows the\n'--remote' in the command 'git submodule update --remote', for example,\nto be fully completed.\n\nSigned-off-by: Denton Liu <liu.denton@gmail.com>\n---\nHi Shawn, sorry this is my first contribution to a mailing-list based\nproject. If I've done anything wrong, please let me know.\n\nThanks,\n\nDenton Liu\n\n---\n contrib/completion/git-completion.bash | 46 ++++++++++++++++++++++++++--------\n 1 file changed, 35 insertions(+), 11 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 21016bf8d..941fbdfe2 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -2556,17 +2556,41 @@ _git_submodule ()\n \t__git_has_doubledash && return\n \n \tlocal subcommands=\"add status init deinit update summary foreach sync\"\n-\tif [ -z \"$(__git_find_on_cmdline \"$subcommands\")\" ]; then\n-\t\tcase \"$cur\" in\n-\t\t--*)\n-\t\t\t__gitcomp \"--quiet --cached\"\n-\t\t\t;;\n-\t\t*)\n-\t\t\t__gitcomp \"$subcommands\"\n-\t\t\t;;\n-\t\tesac\n-\t\treturn\n-\tfi\n+\tlocal subcommand=\"$(__git_find_on_cmdline \"$subcommands\")\"\n+\n+\tcase \"$subcommand,$cur\" in\n+\t,--*)\n+\t\t__gitcomp \"--quiet\"\n+\t\t;;\n+\t,*)\n+\t\t__gitcomp \"$subcommands --quiet\"\n+\t\t;;\n+\tadd,--*)\n+\t\t__gitcomp \"--force --name --reference --depth\"\n+\t\t;;\n+\tstatus,--*)\n+\t\t__gitcomp \"--cached --recursive\"\n+\t\t;;\n+\tdeinit,--*)\n+\t\t__gitcomp \"--force --all\"\n+\t\t;;\n+\tupdate,--*)\n+\t\t__gitcomp \"\n+\t\t\t--init --remote --no-fetch --no-recommended-shallow\n+\t\t\t--recommended-shallow --force --rebase --merge --reference\n+\t\t\t--depth --recursive --jobs\n+\t\t\t\"\n+\t\t;;\n+\tsummary,--*)\n+\t\t__gitcomp \"--cached --files --summary-limit\"\n+\t\t;;\n+\tsummary,*)\n+\t\t__gitcomp_nl \"$(__git_refs)\"\n+\t\t;;\n+\tforeach,--*|sync,--*)\n+\t\t__gitcomp \"--recursive\"\n+\t\t;;\n+\tesac\n }\n \n _git_svn ()\n-- \n2.11.0\n\n"}]}