Re: git git<tab> completes non-existent command `git gitk`
- From
Matheus Tavares Bernardino <matheus.bernardino@usp.br>
- Date
- May 25, 2020, 01:53 UTC
- Message-ID
- <CAHd-oW7b2191haSeoaBu4jvS+PBG04RKGxOhp7+rRQF+b9eErg@mail.gmail.com>
- In-Reply-To
- <xmqqlflgq2nr.fsf@gitster.c.googlers.com>
On Sun, May 24, 2020 at 9:27 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 10 quoted lines
> > Matheus Tavares <matheus.bernardino@usp.br> writes: > > > In the meantime, you could use: > > > > git config completion.commands -gitk > > > > To locally remove the completion for "gitk". > > I think an equivalent of this in-core would be the way to go.
I'm not sure I understand the idea, but would that be something along these lines? Adding a "nocomplete" category in commands-list.txt, to do the opposite of the "complete" we already have[1]. Then adding a new group name to "--list-cmds" (such as "--list-cmds=completeonly"), which would include the commands that are in "complete" and exclude those in "nocomplete"? We then might be able to complete subcommands with the output of:
git --list-cmds=list-mainporcelain,others,nohelpers,alias,completeonly,config
[1]: "nocomplete" would only be relevant in conjunction with "list-mainporcelain", as the commands in the latter (as gitk) are currently completed by default (even without "complete").
> I wonder if there are any commands other than gitk that cannot be > invoked as a subcommand of "git" potty.
In the list suggested by git-completion, I think gitk is the only one (if I haven't missed any).