SZEDER Gábor [off-list ref] writes:
The completion functions for git commands having subcommands usually
start like this:
_git_remote ()
{
local subcommands="
add rename remove set-head set-branches
get-url set-url show prune update
"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
__git_subcommand_idx holds the index of the word "remote", not the
index of "add/rename/etc.", so in the context of the completion script
that name is misleading.
OK. As subsubcommands would be a mouthful, calling "stash" etc. as
"cmd" would be fine.