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

Re: Bash completion for git aliases containing nested subcommands

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Oct 3, 2022, 15:43 UTC
Message-ID
<20221003154354.GC7659@szeder.dev>
In-Reply-To
<1839e62f930.285a.8a94aeaa49923dfb9a7d55a303990d0a@posteo.de>
On Mon, Oct 03, 2022 at 03:07:10PM +0000, Tim Jaacks wrote:
Show 8 quoted lines
> Hi Gabor,
> 
> thanks a lot for your detailed reply! I tried that and it works, thank you.
> 
> Just another small follow-up question, out of curiosity: I noticed that zsh
> handles the alias completion correctly out of the box (using the exact same
> gitconfig file). I don't have any dedicated zsh completion file, just
> installed zsh via apt. Do you know why and how zsh handles this differently?
There are not only one but two Zsh completion scripts for Git:
  - Ours, which is essentially a wrapper around our Bash completion
    script, so it shouldn't work for your alias, and it has to be
    installed manually, so I doubt that this is what you tried.
  - One that's shipped with Zsh, with all the bells and whistles that
    Zsh's completion system offers.  It's not maintained by the Git
    project, and I have no idea how it works, but I guess it works
    sufficiently differently to make your use case work.
Previous: Tim Jaacks
Message 7 of 7 in “Bash completion for git aliases containing nested subcommands”
  1. Tim JaacksOct 3, 2022
  2. SZEDER GáborOct 3, 2022
  3. Jeff KingOct 3, 2022
  4. Tim JaacksOct 4, 2022
  5. SZEDER GáborOct 5, 2022
  6. Tim JaacksOct 3, 2022
  7. SZEDER GáborOct 3, 2022

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.