Bash completion for git aliases containing nested subcommands
- From
Tim Jaacks <timjaacks@posteo.de>
- Date
- Oct 3, 2022, 11:45 UTC
- Message-ID
- <em8d7ca854-51a3-4cb5-aaf9-30ed37b4194b@acer-switch-tim>
Hello everyone,
I have set up the following alias in my .gitconfig file:
[alias]
ss = stash showUnfortunately bash completion does not work correctly on this alias. When I type "git ss <TAB>", I get:
$ git ss <TAB> apply clear drop pop show branch create list push
Which is obviously the completion for "git stash" instead of "git stash show".
With the original command I get the list of available stashes:
$ git stash show <TAB> stash@{0} stash@{1}
Is there a way to get the completion on the alias behave like on the original command?
I am on Ubuntu 20.04 and using the distro's default git completions.
Kind regards, Tim