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

Completion for aliases that wrap aliases that wrap Git commands

From
Philippe Blain <levraiphilippeblain@gmail.com>
Date
Nov 6, 2020, 22:42 UTC
Message-ID
<9717A684-9304-4A65-8566-19F946098455@gmail.com>
Hello all,

I've noticed the following: I have a Git alias that is simply a Git command with some options, like

$ git config --get alias.logo log --abbrev-commit --decorate --format=format:'%C(yellow bold)%h%C(reset) %C(normal)%s%C(reset) %C(dim white)%an%C(reset) %C(dim blue)(%ad)%C(reset) %C(auto)%d%C(reset)'

And another alias that is this previous alias with more options:

$ git config --get alias.lg logo --first-parent

When typing 'git logo up[TAB][TAB]', the Bash completion script suggests 'upstream' (like if I type 'git log up[TAB][TAB]'), but typing 'git lg up[TAB][TAB]' does not suggest anything.

So I'm thinking there is some special logic in the completion script that makes it work for simple aliases but not for recursive aliases.

I know nothing about Bash completions, but I'm wondering if that feature would be possible at all ?

This is on Bash 4.4.19(1) (not that I think it matters very much...)
Cheers,
Philippe.
Next: Felipe Contreras
Message 1 of 3 in “Completion for aliases that wrap aliases that wrap Git commands”
  1. Philippe BlainNov 6, 2020
  2. Felipe ContrerasNov 9, 2020
  3. Philippe BlainNov 10, 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.