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

Re: Bash completion for git aliases containing nested subcommands

From
Tim Jaacks <timjaacks@posteo.de>
Date
Oct 4, 2022, 11:21 UTC
Message-ID
<em34822e40-c62f-43aa-bc9b-2a87e9033ee8@acer-switch-tim>
In-Reply-To
<YzthDLdqeQx6bEcj@coredump.intra.peff.net>
Hi Peff,
thanks a lot for your reply.
 > It feels like this ought to be able to work, for the same reason that
 > "git stash show <TAB>" works. In the non-aliased case, we call into
 > _git_stash(), and it sees that "show" is already there on the command
 > line. But in the aliased case, we know "show" is part of the alias but
 > throw away that information completely, and never feed it to
 > _git_stash() at all.

I actually got the same impression when looking into the __git_aliased_command implementation. I just wasn't familiar enough with the code to actually come up with a solution. So thanks for your patch, that makes my use-case work indeed! Do you think there's a chance to get this upstream?

Best wishes, Tim

Previous: Jeff KingNext: SZEDER Gábor
Message 4 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.