Re:Little Things I Like to Do with Git
by cormacrelf on Wednesday May 24, 2017 @07:46PM
(#14414321)
If shell aliases don't tab-complete for you, you can get tab completion just by defining git aliases instead. One extra space if you also alias g=git. And it solves namespacing.
Re:Little Things I Like to Do with Git
by mikegerwitz on Wednesday May 24, 2017 @08:57PM
(#14414633)
I meant that the alias `b` for `git branch` will have the same bash completion as `git branch`, e.g. branch names.
I don't know if it's the same in bash, but at least in zsh, "git branch <TAB>" and "b <TAB>" have the exact same result, if b is aliased to "git branch"; the first tab fills in the name of the branch, another lets me select a commit, and further tabs are command line options.
Re:Little Things I Like to Do with Git
by mikegerwitz on Friday May 26, 2017 @12:24AM
(#14421988)
That would make sense!
Alas, that is not the case with bash.
https://mikegerwitz.com/projects/git-shortmaps/about/
It creates the aliases as you do, but also includes tab completion, and only takes effect when you're in a repository path.