From: Junio C Hamano Date: Tue, 20 Apr 2021 22:31:47 GMT Subject: Re: [PATCH 2/5] git-completion.bash: rename to $__git_cmd_idx Message-ID: In-Reply-To: <20210420211432.GA3842406@szeder.dev> SZEDER Gábor 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.