I encounter a problem with Zsh autocompletion for some specific git commands (the ones involving a remote and a branch), but only when using aliases.
Here is an example with push
:
$ git push o<TAB>rigin m<TAB>aster # tab completion works
$ git config --global alias.ps push # set a `ps` alias for `push`
$ git ps o<TAB>rigin m<TAB> # tab completion doesn't work for "master"
The same problem occurs with pull
and fetch
.
My .zshrc
can be found here, but I don't think it is related, as I was able to reproduce the problem without using it (just enabling the autocompletion with autoload -U compinit && compinit
).
I'm running OSX 10.9 with the following software versions (both of them installed through brew
):
$ zsh --version
zsh 5.0.2 (x86_64-apple-darwin13.0.0)
$ git --version
git version 1.8.4.2
This problem appeared since I did an OSX 10.9 clean install. So I presume it comes from a recent update either from Zsh or Git.
The problem came from a bug in the Git completion for both Bash and Zsh. @felipec took the time to fix it. Thanks, it works like a charm now!