3 local curcontext="$curcontext" state line
15 'init:Initialize a new git repo with support for the branching model.'
16 'feature:Manage your feature branches.'
17 'bugfix:Manage your bugfix branches.'
18 'config:Manage your configuration.'
19 'release:Manage your release branches.'
20 'hotfix:Manage your hotfix branches.'
21 'support:Manage your support branches.'
22 'version:Shows version information.'
23 'finish:Finish the branch you are currently on.'
24 'delete:Delete the branch you are currently on.'
25 'publish:Publish the branch you are currently on.'
26 'rebase:Rebase the branch you are currently on.'
28 _describe -t commands 'git flow' subcommands
36 -f'[Force setting of gitflow branches, even if already configured]'
68 local curcontext="$curcontext" state line
72 ':command:->command' \
73 '*::options:->options'
80 'start:Start a new release branch.'
81 'finish:Finish a release branch.'
82 'list:List all your release branches. (Alias to `git flow release`)'
83 'publish:Publish release branch to remote.'
84 'track:Checkout remote release branch.'
85 'rebase:Rebase from integration branch.'
86 'delete:Delete a release branch.'
88 _describe -t commands 'git flow release' subcommands
90 -v'[Verbose (more) output]'
98 -F'[Fetch from origin before performing finish]'\
99 ':version:__git_flow_version_list'
104 -F'[Fetch from origin before performing finish]' \
105 -s'[Sign the release tag cryptographically]'\
106 -u'[Use the given GPG-key for the digital signature (implies -s)]'\
107 -m'[Use the given tag message]'\
108 -p'[Push to $ORIGIN after performing finish]'\
109 ':version:__git_flow_version_list'
114 -f'[Force deletion]' \
115 -r'[Delete remote branch]' \
116 ':version:__git_flow_version_list'
121 ':version:__git_flow_version_list'
126 ':version:__git_flow_version_list'
131 -i'[Do an interactive rebase]' \
132 ':branch:__git_branch_names'
137 -v'[Verbose (more) output]'
146 local curcontext="$curcontext" state line
150 ':command:->command' \
151 '*::options:->options'
158 'start:Start a new hotfix branch.'
159 'finish:Finish a hotfix branch.'
160 'delete:Delete a hotfix branch.'
161 'rebase:Rebase from integration branch.'
162 'list:List all your hotfix branches. (Alias to `git flow hotfix`)'
163 'rename:Rename a hotfix branch.'
165 _describe -t commands 'git flow hotfix' subcommands
167 -v'[Verbose (more) output]'
175 -F'[Fetch from origin before performing finish]'\
176 ':hotfix:__git_flow_version_list'\
177 ':branch-name:__git_branch_names'
182 -F'[Fetch from origin before performing finish]' \
183 -s'[Sign the release tag cryptographically]'\
184 -u'[Use the given GPG-key for the digital signature (implies -s)]'\
185 -m'[Use the given tag message]'\
186 -p'[Push to $ORIGIN after performing finish]'\
187 ':hotfix:__git_flow_hotfix_list'
192 -f'[Force deletion]' \
193 -r'[Delete remote branch]' \
194 ':hotfix:__git_flow_hotfix_list'
199 -i'[Do an interactive rebase]' \
200 ':branch:__git_branch_names'
205 -v'[Verbose (more) output]'
212 __git-flow-feature ()
214 local curcontext="$curcontext" state line
218 ':command:->command' \
219 '*::options:->options'
226 'start:Start a new feature branch.'
227 'finish:Finish a feature branch.'
228 'delete:Delete a feature branch.'
229 'list:List all your feature branches. (Alias to `git flow feature`)'
230 'publish:Publish feature branch to remote.'
231 'track:Checkout remote feature branch.'
232 'diff:Show all changes.'
233 'rebase:Rebase from integration branch.'
234 'checkout:Checkout local feature branch.'
235 'pull:Pull changes from remote.'
236 'rename:Rename a feature branch.'
238 _describe -t commands 'git flow feature' subcommands
240 -v'[Verbose (more) output]'
248 -F'[Fetch from origin before performing finish]'\
249 ':feature:__git_flow_feature_list'\
250 ':branch-name:__git_branch_names'
255 -F'[Fetch from origin before performing finish]' \
256 -r'[Rebase instead of merge]'\
257 ':feature:__git_flow_feature_list'
262 -f'[Force deletion]' \
263 -r'[Delete remote branch]' \
264 ':feature:__git_flow_feature_list'
269 ':feature:__git_flow_feature_list'\
274 ':feature:__git_flow_feature_list'\
279 ':branch:__git_branch_names'\
284 -i'[Do an interactive rebase]' \
285 ':branch:__git_branch_names'
290 ':branch:__git_flow_feature_list'\
295 ':remote:__git_remotes'\
296 ':branch:__git_branch_names'
301 -v'[Verbose (more) output]'
310 local curcontext="$curcontext" state line
314 ':command:->command' \
315 '*::options:->options'
322 'start:Start a new bugfix branch.'
323 'finish:Finish a bugfix branch.'
324 'delete:Delete a bugfix branch.'
325 'list:List all your bugfix branches. (Alias to `git flow bugfix`)'
326 'publish:Publish bugfix branch to remote.'
327 'track:Checkout remote bugfix branch.'
328 'diff:Show all changes.'
329 'rebase:Rebase from integration branch.'
330 'checkout:Checkout local bugfix branch.'
331 'pull:Pull changes from remote.'
332 'rename:Rename a bugfix branch.'
334 _describe -t commands 'git flow bugfix' subcommands
336 -v'[Verbose (more) output]'
344 -F'[Fetch from origin before performing finish]'\
345 ':bugfix:__git_flow_bugfix_list'\
346 ':branch-name:__git_branch_names'
351 -F'[Fetch from origin before performing finish]' \
352 -r'[Rebase instead of merge]'\
353 ':bugfix:__git_flow_bugfix_list'
358 -f'[Force deletion]' \
359 -r'[Delete remote branch]' \
360 ':bugfix:__git_flow_bugfix_list'
365 ':bugfix:__git_flow_bugfix_list'\
370 ':bugfix:__git_flow_bugfix_list'\
375 ':branch:__git_branch_names'\
380 -i'[Do an interactive rebase]' \
381 ':branch:__git_branch_names'
386 ':branch:__git_flow_bugfix_list'\
391 ':remote:__git_remotes'\
392 ':branch:__git_branch_names'
397 -v'[Verbose (more) output]'
406 local curcontext="$curcontext" state line
410 ':command:->command' \
411 '*::options:->options'
418 'list:List the configuration. (Alias to `git flow config`)'
419 'set:Set the configuration option'
421 _describe -t commands 'git flow config' subcommands
429 --local'[Use repository config file]' \
430 --global'[Use global config file]'\
431 --system'[Use system config file]'\
432 --file'[Use given config file]'\
433 ':option:(master develop feature hotfix release support versiontagprefix)'
438 --local'[Use repository config file]' \
439 --global'[Use global config file]'\
440 --system'[Use system config file]'\
441 --file'[Use given config file]'
447 __git_flow_version_list ()
452 versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}})
453 __git_command_successful || return
455 _wanted versions expl 'version' compadd $versions
458 __git_flow_feature_list ()
463 features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}})
464 __git_command_successful || return
466 _wanted features expl 'feature' compadd $features
469 __git_flow_bugfix_list ()
474 bugfixes=(${${(f)"$(_call_program bugfixes git flow bugfix list 2> /dev/null | tr -d ' |*')"}})
475 __git_command_successful || return
477 _wanted bugfixes expl 'bugfix' compadd $bugfixes
481 local expl gitdir remotes
483 gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
484 __git_command_successful || return
486 remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]})
487 __git_command_successful || return
489 # TODO: Should combine the two instead of either or.
490 if (( $#remotes > 0 )); then
491 _wanted remotes expl remote compadd $* - $remotes
493 _wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*"
497 __git_flow_hotfix_list ()
502 hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}})
503 __git_command_successful || return
505 _wanted hotfixes expl 'hotfix' compadd $hotfixes
508 __git_branch_names () {
510 declare -a branch_names
512 branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
513 __git_command_successful || return
515 _wanted branch-names expl branch-name compadd $* - $branch_names
518 __git_command_successful () {
519 if (( ${#pipestatus:#0} > 0 )); then
520 _message 'not a git repository'
526 zstyle ':completion:*:*:git:*' user-commands flow:'provide high-level repository operations'