8e368c1222a9ccd9203c6f19eba9db61bf4c27f8

Author
Tima Maslyuchenko <insside@gmail.com>
Committer
Tima Maslyuchenko <insside@gmail.com>
Date

Message

added hub autocomplete instructions

Diff

 1diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh
 2index 598b059c18753f0f76002a2e93046f037c1c9e56..66a10cfdb14ca966a6d9a948a58487d63bbed69a 100644
 3--- a/plugins/github/github.plugin.zsh
 4+++ b/plugins/github/github.plugin.zsh
 5@@ -1,5 +1,22 @@
 6 # Setup hub function for git, if it is available; http://github.com/defunkt/hub
 7 if [ "$commands[(I)hub]" ] && [ "$commands[(I)ruby]" ]; then
 8+    # Autoload _git completion functions
 9+    if declare -f _git > /dev/null; then
10+      _git
11+    fi
12+    
13+    if declare -f _git_commands > /dev/null; then
14+        _hub_commands=(
15+            'alias:show shell instructions for wrapping git'
16+            'pull-request:open a pull request on GitHub'
17+            'fork:fork origin repo on GitHub'
18+            'create:create new repo on GitHub for the current project'
19+            'browse:browse the project on GitHub'
20+            'compare:open GitHub compare view'
21+        )
22+        # Extend the '_git_commands' function with hub commands
23+        eval "$(declare -f _git_commands | sed -e 's/base_commands=(/base_commands=(${_hub_commands} /')"
24+    fi
25     # eval `hub alias -s zsh`
26     function git(){
27         if ! (( $+_has_working_hub  )); then