git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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).

Previous: Junio C Hamano
Message 4 of 4 in “git git<tab> completes non-existent command `git gitk`”
  1. Anthony SottileMay 23, 2020
  2. Matheus TavaresMay 24, 2020
  3. Junio C HamanoMay 25, 2020
  4. Matheus Tavares BernardinoMay 25, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.