robbyrussell/oh-my-zsh — pull request #1887 by tgkokk (2013-06-12 17:31:53+00:00)
Title: Fixed slow behavior when using GitHub wrappers

See pull defunkt/hub#319. FYI, hub is a wrapper for git that adds some nice features related to GitHub. Any commands it can't handle will be forwarded to the normal git binary. This behavior makes it suitable for aliasing to git. This is also what the github plugin for oh-my-zsh does.

Unfortunately, oh-my-zsh uses $(git) for lib/git.zsh, instead of $(command git). Thus, hub is executed, which is slower than git and isn't needed for what this file does (branch name indicator, dirty working tree indicator etc.).

Comparison between the two:

$ time command git version
git version 1.7.10.4
command git version 0.00s user 0.00s system 70% cpu 0.006 total

$ time hub version
git version 1.7.10.4
hub version 1.10.6
hub version 0.46s user 0.06s system 94% cpu 0.549 total