added hub autocomplete instructions #1686

merged 1 commit into from Apr 8, 2013


None yet
6 participants

timsly commented Apr 3, 2013

See here


robbyrussell commented Apr 8, 2013

Thanks, can you add some details to our Plugins page?

robbyrussell added a commit that referenced this pull request Apr 8, 2013

Merge pull request #1686 from timsly/hub-autocomplete
added hub autocomplete instructions

@robbyrussell robbyrussell merged commit b95c0e8 into robbyrussell:master Apr 8, 2013

FYI, this is broken for me. I had to stop using the github plugin because I kept getting the following error whenever starting a shell:

(anon):6: command not found: ___main
_default:compcall:12: can only be called from completion function

This was with the latest (which is pretty old) release of hub from homebrew. Not exactly sure why; maybe hub tries to load its own completion functions and then this plugin messes it up? I was able to fix it by following @goodell's instructions here: defunkt/hub#295 (comment) and then uninstalling the github plugin from oh-my-zsh.

wmayner commented Aug 17, 2013


cbeams commented Apr 21, 2014

I've been trying to get autocompletion of hub commands working with no luck.

Take a look at

Any recommendations?

$ zsh --version; git --version
zsh 5.0.2 (x86_64-apple-darwin13.0)
git version 1.8.0
hub version 1.12.0

w31 pushed a commit to w31/oh-my-zsh that referenced this pull request Apr 30, 2014

Merge pull request #1686 from timsly/hub-autocomplete
added hub autocomplete instructions

apjanke commented Oct 2, 2015

+    # Autoload _git completion functions
+    if declare -f _git > /dev/null; then
+      _git
+    fi

is not autoloading the _git function; it is actually running it. Outside the context of ZLE completion, that won't work, and will produce the error @davidcelis is seeing.

The normal _git files supplied by the zsh or git installations are autoloadable files. That's the normal zsh convention for files named _functionname. Some programs supply _foo files that are intended to be run directly, though; I've seen this with awscli. Sounds like this change may have been written against a version of _git like that. Is this the case? Is this plugin intended to be compatible with the current _git files from zsh and git?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment