Thread (1 message) 1 message, 1 author, 2021-04-20

Re: [PATCH 2/5] git-completion.bash: rename to $__git_cmd_idx

From: Junio C Hamano <hidden>
Date: 2021-04-20 22:31:52

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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help