2 alias ghff='git hf feature'
3 alias ghfr='git hf release'
4 alias ghfh='git hf hotfix'
5 alias ghfs='git hf support'
6 alias ghfu='git hf update'
10 local curcontext="$curcontext" state line
14 ':command:->command' \
15 '*::options:->options'
22 'init:Initialize a new git repo with support for the branching model.'
23 'feature:Manage your feature branches.'
24 'release:Manage your release branches.'
25 'hotfix:Manage your hotfix branches.'
26 'support:Manage your support branches.'
27 'update:Pull upstream changes down into your master and develop branches.'
28 'version:Shows version information.'
30 _describe -t commands 'git hf' subcommands
38 -f'[Force setting of gitflow branches, even if already configured]'
62 local curcontext="$curcontext" state line
66 ':command:->command' \
67 '*::options:->options'
74 'start:Start a new release branch.'
75 'finish:Finish a release branch.'
76 'list:List all your release branches. (Alias to `git hf release`)'
77 'cancel:Cancel release'
78 'push:Push release to GitHub'
79 'pull:Pull release from GitHub'
82 _describe -t commands 'git hf release' subcommands
84 -v'[Verbose (more) output]'
92 -F'[Fetch from origin before performing finish]'\
93 ':version:__git_hf_version_list'
98 -F'[Fetch from origin before performing finish]' \
99 -s'[Sign the release tag cryptographically]'\
100 -u'[Use the given GPG-key for the digital signature (implies -s)]'\
101 -m'[Use the given tag message]'\
102 -p'[Push to $ORIGIN after performing finish]'\
103 -k'[Keep branch after performing finish]'\
104 -n"[Don't tag this release]"\
105 ':version:__git_hf_version_list'
110 -v'[Verbose (more) output]'
119 local curcontext="$curcontext" state line
123 ':command:->command' \
124 '*::options:->options'
131 'start:Start a new hotfix branch.'
132 'finish:Finish a hotfix branch.'
133 'list:List all your hotfix branches. (Alias to `git hf hotfix`)'
134 'publish:Publish the hotfix branch.'
135 'track:Track the hotfix branch.'
136 'pull:Pull the hotfix from GitHub.'
137 'push:Push the hotfix to GitHub.'
138 'cancel:Cancel the hotfix.'
140 _describe -t commands 'git hf hotfix' subcommands
142 -v'[Verbose (more) output]'
150 -F'[Fetch from origin before performing finish]'\
151 ':hotfix:__git_hf_version_list'\
152 ':branch-name:__git_branch_names'
157 -F'[Fetch from origin before performing finish]' \
158 -s'[Sign the release tag cryptographically]'\
159 -u'[Use the given GPG-key for the digital signature (implies -s)]'\
160 -m'[Use the given tag message]'\
161 -p'[Push to $ORIGIN after performing finish]'\
162 -k'[Keep branch after performing finish]'\
163 -n"[Don't tag this release]"\
164 ':hotfix:__git_hf_hotfix_list'
169 -v'[Verbose (more) output]'
178 local curcontext="$curcontext" state line
182 ':command:->command' \
183 '*::options:->options'
190 'list:List all your feature branches. (Alias to `git hf feature`)'
191 'start:Start a new feature branch'
192 'finish:Finish a feature branch'
196 'rebase:Rebase feature branch against develop'
197 'checkout:Checkout feature'
198 'pull:Pull feature branch from GitHub'
199 'push:Push feature branch to GitHub'
200 'cancel:Cancel feature'
202 _describe -t commands 'git hf feature' subcommands
204 -v'[Verbose (more) output]'
212 -F'[Fetch from origin before performing finish]'\
213 ':feature:__git_hf_feature_list'\
214 ':branch-name:__git_branch_names'
219 -F'[Fetch from origin before performing finish]' \
220 -r'[Rebase instead of merge]'\
221 ':feature:__git_hf_feature_list'
226 ':feature:__git_hf_feature_list'\
231 ':feature:__git_hf_feature_list'\
236 ':branch:__git_branch_names'\
241 -i'[Do an interactive rebase]' \
242 ':branch:__git_branch_names'
247 ':branch:__git_hf_feature_list'\
252 ':remote:__git_remotes'\
253 ':branch:__git_branch_names'
258 -v'[Verbose (more) output]'
265 __git_hf_version_list ()
270 versions=(${${(f)"$(_call_program versions git hf release list 2> /dev/null | tr -d ' |*')"}})
271 __git_command_successful || return
273 _wanted versions expl 'version' compadd $versions
276 __git_hf_feature_list ()
281 features=(${${(f)"$(_call_program features git hf feature list 2> /dev/null | tr -d ' |*')"}})
282 __git_command_successful || return
284 _wanted features expl 'feature' compadd $features
288 local expl gitdir remotes
290 gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
291 __git_command_successful || return
293 remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]})
294 __git_command_successful || return
296 # TODO: Should combine the two instead of either or.
297 if (( $#remotes > 0 )); then
298 _wanted remotes expl remote compadd $* - $remotes
300 _wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*"
304 __git_hf_hotfix_list ()
309 hotfixes=(${${(f)"$(_call_program hotfixes git hf hotfix list 2> /dev/null | tr -d ' |*')"}})
310 __git_command_successful || return
312 _wanted hotfixes expl 'hotfix' compadd $hotfixes
315 __git_branch_names () {
317 declare -a branch_names
319 branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
320 __git_command_successful || return
322 _wanted branch-names expl branch-name compadd $* - $branch_names
325 __git_command_successful () {
326 if (( ${#pipestatus:#0} > 0 )); then
327 _message 'not a git repository'
333 zstyle ':completion:*:*:git:*' user-commands flow:'description for foo'