pax_global_header00006660000000000000000000000064131077135640014521gustar00rootroot0000000000000052 comment=990d7200e24e6a15e46258aa5e5effa95a66897b git-flow-completion-0.6.0/000077500000000000000000000000001310771356400154235ustar00rootroot00000000000000git-flow-completion-0.6.0/AUTHORS000066400000000000000000000011721310771356400164740ustar00rootroot00000000000000git-flow completion AVH Authors This software consists of voluntary contributions made by many individuals. For exact contribution history, see the revision history (CHANGELOG.md) and logs, available at http://github.com/petervanderdoes/git-flow-completion Justin Hileman Peter van der Does Zifei Tong Alejandro Varas Marius Loewe Matt Cable Serhiy Oplakanets Austin Matzko Corin Langosch Dominique Lasserre Jeffrey Gipson MURAOKA Yusuke Milan Mitrović Seth Voltz Vincent Driessen nhuray Portions of the project are derived from other open source works are clearly marked. This file is auto generated, any changes will be lost. git-flow-completion-0.6.0/CHANGELOG.md000066400000000000000000000016311310771356400172350ustar00rootroot00000000000000[petervanderdoes]: https://github.com/petervanderdoes "Peter van der Does on github" [erlendk]: https://github.com/erlendk "Erlend Kristiansen on github" [remedy93]: https://github.com/remedy93 "remedy93 on githib" # Changelog #### 0.6.0 [Peter van der Does][petervanderdoes] * Add rename command [Erlend Kristiansen][erlendk] * Fix bash completion for bugfix command. [remedy93] * Fix zsh completion for bugfix command. #### 0.5.2 [Peter van der Does][petervanderdoes] * Add missing commands: publish, rebase, bugfix, finish, delete * Add rebase subcommand for release, hotfix, support #### 0.5.0 [Peter van der Does][petervanderdoes] * Update bash completion script. We added completion of flags and (sub)commands. #### Older versions No change history is recorded prior to 0.5.0 releases. #### Glossary * RFC: Request For Change. This indicates a new or improved function requested by one or more users. git-flow-completion-0.6.0/LICENSE000066400000000000000000000020701310771356400164270ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) 2010 Justin Hileman Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. git-flow-completion-0.6.0/README.markdown000066400000000000000000000046241310771356400201320ustar00rootroot00000000000000# git-flow-completion Bash, Zsh and fish completion support for [git-flow (AVH Edition)](http://github.com/petervanderdoes/gitflow). The contained completion routines provide support for completing: * git-flow init and version * feature, hotfix and release branches * remote feature, hotfix and release branch names ## Changelog #### Current develop * Update bash completion script. We added completion of flags and (sub)commands. ## Installation for Bash To achieve git-flow completion nirvana: 0. [Install git-completion](http://github.com/petervanderdoes/git-flow-completion/wiki/Install-Bash-git-completion). 1. Install `git-flow-completion.bash`. Either: 1. Place it in your `bash_completion.d` folder, usually something like `/etc/bash_completion.d`, `/usr/local/etc/bash_completion.d` or `~/bash_completion.d`. 2. Or, copy it somewhere (e.g. `~/git-flow-completion.bash`) and put the following line in the `.profile` or `.bashrc` file in your home directory: source ~/git-flow-completion.bash 2. If you are using Git < 1.7.1, you will need to edit git completion (usually `/etc/bash_completion.d/git` or `git-completion.sh`) and add the following line to the `$command` case in `_git`: _git () { [...] case "$command" in [...] flow) _git_flow ;; *) COMPREPLY=() ;; esac } ## Installation for Zsh To achieve git-flow completion nirvana: 0. Update your zsh's git-completion module to the newest version -- [available here](http://sourceforge.net/p/zsh/code/ci/master/tree/Completion/Unix/Command/_git). Optional if you have an up-to-date version of zsh. 1. Install `git-flow-completion.zsh`. Either: 1. Place it in your `.zshrc`. 2. Or, copy it somewhere (e.g. `~/.git-flow-completion.zsh`) and put the following line in your `.zshrc`: source ~/.git-flow-completion.zsh 3. Or, use this file as an oh-my-zsh plugin. ## Installation for fish To achieve git-flow completion nirvana: 1. Install `git.fish` in your `~/.config/fish/completions` folder. ## The Fine Print Author: Copyright 2012-2013 Peter van der Does. Original Author: Copyright (c) 2011 [Justin Hileman](http://justinhileman.com) Distributed under the [MIT License](http://creativecommons.org/licenses/MIT/) git-flow-completion-0.6.0/git-flow-completion.bash000077500000000000000000000342121310771356400221660ustar00rootroot00000000000000#!bash # # git-flow-completion # =================== # # Bash completion support for [git-flow (AVH Edition)](http://github.com/petervanderdoes/gitflow) # # The contained completion routines provide support for completing: # # * git-flow init and version # * feature, bugfix, hotfix and release branches # * remote feature, bugfix, hotfix and release branch names # # # Installation # ------------ # # To achieve git-flow completion nirvana: # # 0. Install git-completion. # # 1. Install this file. Either: # # a. Place it in a `bash-completion.d` folder: # # * /etc/bash-completion.d # * /usr/local/etc/bash-completion.d # * ~/bash-completion.d # # b. Or, copy it somewhere (e.g. ~/.git-flow-completion.sh) and put the following line in # your .bashrc: # # source ~/.git-flow-completion.sh # # 2. If you are using Git < 1.7.1: Edit git-completion.sh and add the following line to the giant # $command case in _git: # # flow) _git_flow ;; # # # The Fine Print # -------------- # # Author: # Copyright 2012-2013 Peter van der Does. # # Original Author: # Copyright (c) 2011 [Justin Hileman](http://justinhileman.com) # # Distributed under the [MIT License](http://creativecommons.org/licenses/MIT/) __git_flow_config_file_options=" --local --global --system --file= " _git_flow () { local subcommands="init feature bugfix release hotfix support help version config finish delete publish rebase" local subcommand="$(__git_find_on_cmdline "$subcommands")" if [ -z "$subcommand" ]; then __gitcomp "$subcommands" return fi case "$subcommand" in init) __git_flow_init return ;; feature) __git_flow_feature return ;; bugfix) __git_flow_bugfix return ;; release) __git_flow_release return ;; hotfix) __git_flow_hotfix return ;; support) __git_flow_support return ;; config) __git_flow_config return ;; *) COMPREPLY=() ;; esac } __git_flow_init () { local subcommands="help" local subcommand="$(__git_find_on_cmdline "$subcommands")" if [ -z "$subcommand" ]; then __gitcomp "$subcommands" fi case "$cur" in --*) __gitcomp " --nodefaults --defaults --noforce --force $__git_flow_config_file_options " return ;; esac } __git_flow_feature () { local subcommands="list start finish publish track diff rebase checkout pull help delete rename" local subcommand="$(__git_find_on_cmdline "$subcommands")" if [ -z "$subcommand" ]; then __gitcomp "$subcommands" return fi case "$subcommand" in pull) __gitcomp_nl "$(__git_remotes)" return ;; checkout) __gitcomp_nl "$(__git_flow_list_local_branches 'feature')" return ;; delete) case "$cur" in --*) __gitcomp " --noforce --force --noremote --remote " return ;; esac __gitcomp_nl "$(__git_flow_list_local_branches 'feature')" return ;; finish) case "$cur" in --*) __gitcomp " --nofetch --fetch --norebase --rebase --nopreserve-merges --preserve-merges --nokeep --keep --keepremote --keeplocal --noforce_delete --force_delete --nosquash --squash --no-ff " return ;; esac __gitcomp_nl "$(__git_flow_list_local_branches 'feature')" return ;; diff) __gitcomp_nl "$(__git_flow_list_local_branches 'feature')" return ;; rebase) case "$cur" in --*) __gitcomp " --nointeractive --interactive --nopreserve-merges --preserve-merges " return ;; esac __gitcomp_nl "$(__git_flow_list_local_branches 'feature')" return ;; publish) __gitcomp_nl "$(__git_flow_list_branches 'feature')" return ;; track) __gitcomp_nl "$(__git_flow_list_branches 'feature')" return ;; *) COMPREPLY=() ;; esac } __git_flow_bugfix () { local subcommands="list start finish publish track diff rebase checkout pull help delete rename" local subcommand="$(__git_find_on_cmdline "$subcommands")" if [ -z "$subcommand" ]; then __gitcomp "$subcommands" return fi case "$subcommand" in pull) __gitcomp_nl "$(__git_remotes)" return ;; checkout) __gitcomp_nl "$(__git_flow_list_local_branches 'bugfix')" return ;; delete) case "$cur" in --*) __gitcomp " --noforce --force --noremote --remote " return ;; esac __gitcomp_nl "$(__git_flow_list_local_branches 'bugfix')" return ;; finish) case "$cur" in --*) __gitcomp " --nofetch --fetch --norebase --rebase --nopreserve-merges --preserve-merges --nokeep --keep --keepremote --keeplocal --noforce_delete --force_delete --nosquash --squash --no-ff " return ;; esac __gitcomp_nl "$(__git_flow_list_local_branches 'bugfix')" return ;; diff) __gitcomp_nl "$(__git_flow_list_local_branches 'bugfix')" return ;; rebase) case "$cur" in --*) __gitcomp " --nointeractive --interactive --nopreserve-merges --preserve-merges " return ;; esac __gitcomp_nl "$(__git_flow_list_local_branches 'bugfix')" return ;; publish) __gitcomp_nl "$(__git_flow_list_branches 'bugfix')" return ;; track) __gitcomp_nl "$(__git_flow_list_branches 'bugfix')" return ;; *) COMPREPLY=() ;; esac } __git_flow_release () { local subcommands="list start finish track publish help delete" local subcommand="$(__git_find_on_cmdline "$subcommands")" if [ -z "$subcommand" ]; then __gitcomp "$subcommands" return fi case "$subcommand" in finish) case "$cur" in --*) __gitcomp " --nofetch --fetch --sign --signingkey --message --nomessagefile --messagefile= --nopush --push --nokeep --keep --keepremote --keeplocal --noforce_delete --force_delete --notag --tag --nonobackmerge --nobackmerge --nosquash --squash --squash-info " return ;; esac __gitcomp_nl "$(__git_flow_list_local_branches 'release')" return ;; rebase) case "$cur" in --*) __gitcomp " --nointeractive --interactive --nopreserve-merges --preserve-merges " return ;; esac __gitcomp_nl "$(__git_flow_list_local_branches 'release')" return ;; delete) case "$cur" in --*) __gitcomp " --noforce --force --noremote --remote " return ;; esac __gitcomp_nl "$(__git_flow_list_local_branches 'release')" return ;; publish) __gitcomp_nl "$(__git_flow_list_branches 'release')" return ;; track) __gitcomp_nl "$(__git_flow_list_branches 'release')" return ;; start) case "$cur" in --*) __gitcomp " --nofetch --fetch " return ;; esac return ;; *) COMPREPLY=() ;; esac } __git_flow_hotfix () { local subcommands="list start finish track publish help delete rename" local subcommand="$(__git_find_on_cmdline "$subcommands")" if [ -z "$subcommand" ]; then __gitcomp "$subcommands" return fi case "$subcommand" in finish) case "$cur" in --*) __gitcomp " --nofetch --fetch --sign --signingkey --message --nomessagefile --messagefile= --nopush --push --nokeep --keep --keepremote --keeplocal --noforce_delete --force_delete --notag --tag --nonobackmerge --nobackmerge --nosquash --squash --squash-info " return ;; esac __gitcomp_nl "$(__git_flow_list_local_branches 'hotfix')" return ;; rebase) case "$cur" in --*) __gitcomp " --nointeractive --interactive --nopreserve-merges --preserve-merges " return ;; esac __gitcomp_nl "$(__git_flow_list_local_branches 'hotfix')" return ;; delete) case "$cur" in --*) __gitcomp " --noforce --force --noremote --remote " return ;; esac __gitcomp_nl "$(__git_flow_list_local_branches 'hotfix')" return ;; publish) __gitcomp_nl "$(__git_flow_list_branches 'hotfix')" return ;; track) __gitcomp_nl "$(__git_flow_list_branches 'hotfix')" return ;; start) case "$cur" in --*) __gitcomp " --nofetch --fetch " return ;; esac return ;; *) COMPREPLY=() ;; esac } __git_flow_support () { local subcommands="list start help" local subcommand="$(__git_find_on_cmdline "$subcommands")" if [ -z "$subcommand" ]; then __gitcomp "$subcommands" return fi case "$subcommand" in start) case "$cur" in --*) __gitcomp " --nofetch --fetch " return ;; esac return ;; rebase) case "$cur" in --*) __gitcomp " --nointeractive --interactive --nopreserve-merges --preserve-merges " return ;; esac __gitcomp_nl "$(__git_flow_list_local_branches 'support')" return ;; *) COMPREPLY=() ;; esac } __git_flow_config () { local subcommands="list set base" local subcommand="$(__git_find_on_cmdline "$subcommands")" if [ -z "$subcommand" ]; then __gitcomp "$subcommands" return fi case "$subcommand" in set) case "$cur" in --*) __gitcomp " $__git_flow_config_file_options " return ;; esac __gitcomp " master develop feature bugfix hotfix release support versiontagprefix " return ;; base) case "$cur" in --*) __gitcomp " set get " return ;; esac __gitcomp_nl "$(__git_flow_list_local_branches)" return ;; *) COMPREPLY=() ;; esac } __git_flow_prefix () { case "$1" in feature|bugfix|release|hotfix|support) git config "gitflow.prefix.$1" 2> /dev/null || echo "$1/" return ;; esac } __git_flow_list_local_branches () { if [ -n "$1" ]; then local prefix="$(__git_flow_prefix $1)" git for-each-ref --shell --format="ref=%(refname:short)" refs/heads/$prefix | \ while read -r entry; do eval "$entry" ref="${ref#$prefix}" echo "$ref" done | sort else git for-each-ref --format="ref=%(refname:short)" refs/heads/ | sort fi } __git_flow_list_remote_branches () { local prefix="$(__git_flow_prefix $1)" local origin="$(git config gitflow.origin 2> /dev/null || echo "origin")" git for-each-ref --shell --format='%(refname:short)' refs/remotes/$origin/$prefix | \ while read -r entry; do eval "$entry" ref="${ref##$prefix}" echo "$ref" done | sort } __git_flow_list_branches () { local origin="$(git config gitflow.origin 2> /dev/null || echo "origin")" if [ -n "$1" ]; then local prefix="$(__git_flow_prefix $1)" git for-each-ref --shell --format="ref=%(refname:short)" refs/heads/$prefix refs/remotes/$origin/$prefix | \ while read -r entry; do eval "$entry" ref="${ref##$prefix}" echo "$ref" done | sort else git for-each-ref --format="%(refname:short)" refs/heads/ refs/remotes/$origin | sort fi } # alias __git_find_on_cmdline for backwards compatibility if [ -z "`type -t __git_find_on_cmdline`" ]; then alias __git_find_on_cmdline=__git_find_subcommand fi git-flow-completion-0.6.0/git-flow-completion.plugin.zsh000077700000000000000000000000001310771356400277652git-flow-completion.zshustar00rootroot00000000000000git-flow-completion-0.6.0/git-flow-completion.zsh000066400000000000000000000400771310771356400220600ustar00rootroot00000000000000#!zsh # # Installation # ------------ # # To achieve git-flow completion nirvana: # # 0. Update your zsh's git-completion module to the newest verion. # From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD # # 1. Install this file. Either: # # a. Place it in your .zshrc: # # b. Or, copy it somewhere (e.g. ~/.git-flow-completion.zsh) and put the following line in # your .zshrc: # # source ~/.git-flow-completion.zsh # # c. Or, use this file as a oh-my-zsh plugin. # _git-flow () { local curcontext="$curcontext" state line typeset -A opt_args _arguments -C \ ':command:->command' \ '*::options:->options' case $state in (command) local -a subcommands subcommands=( 'init:Initialize a new git repo with support for the branching model.' 'feature:Manage your feature branches.' 'bugfix:Manage your bugfix branches.' 'config:Manage your configuration.' 'release:Manage your release branches.' 'hotfix:Manage your hotfix branches.' 'support:Manage your support branches.' 'version:Shows version information.' 'finish:Finish the branch you are currently on.' 'delete:Delete the branch you are currently on.' 'publish:Publish the branch you are currently on.' 'rebase:Rebase the branch you are currently on.' ) _describe -t commands 'git flow' subcommands ;; (options) case $line[1] in (init) _arguments \ -f'[Force setting of gitflow branches, even if already configured]' ;; (version) ;; (hotfix) __git-flow-hotfix ;; (release) __git-flow-release ;; (feature) __git-flow-feature ;; (bugfix) __git-flow-bugfix ;; (config) __git-flow-config ;; esac ;; esac } __git-flow-release () { local curcontext="$curcontext" state line typeset -A opt_args _arguments -C \ ':command:->command' \ '*::options:->options' case $state in (command) local -a subcommands subcommands=( 'start:Start a new release branch.' 'finish:Finish a release branch.' 'list:List all your release branches. (Alias to `git flow release`)' 'publish:Publish release branch to remote.' 'track:Checkout remote release branch.' 'rebase:Rebase from integration branch.' 'delete:Delete a release branch.' ) _describe -t commands 'git flow release' subcommands _arguments \ -v'[Verbose (more) output]' ;; (options) case $line[1] in (start) _arguments \ -F'[Fetch from origin before performing finish]'\ ':version:__git_flow_version_list' ;; (finish) _arguments \ -F'[Fetch from origin before performing finish]' \ -s'[Sign the release tag cryptographically]'\ -u'[Use the given GPG-key for the digital signature (implies -s)]'\ -m'[Use the given tag message]'\ -p'[Push to $ORIGIN after performing finish]'\ ':version:__git_flow_version_list' ;; (delete) _arguments \ -f'[Force deletion]' \ -r'[Delete remote branch]' \ ':version:__git_flow_version_list' ;; (publish) _arguments \ ':version:__git_flow_version_list' ;; (track) _arguments \ ':version:__git_flow_version_list' ;; (rebase) _arguments \ -i'[Do an interactive rebase]' \ ':branch:__git_branch_names' ;; *) _arguments \ -v'[Verbose (more) output]' ;; esac ;; esac } __git-flow-hotfix () { local curcontext="$curcontext" state line typeset -A opt_args _arguments -C \ ':command:->command' \ '*::options:->options' case $state in (command) local -a subcommands subcommands=( 'start:Start a new hotfix branch.' 'finish:Finish a hotfix branch.' 'delete:Delete a hotfix branch.' 'rebase:Rebase from integration branch.' 'list:List all your hotfix branches. (Alias to `git flow hotfix`)' 'rename:Rename a hotfix branch.' ) _describe -t commands 'git flow hotfix' subcommands _arguments \ -v'[Verbose (more) output]' ;; (options) case $line[1] in (start) _arguments \ -F'[Fetch from origin before performing finish]'\ ':hotfix:__git_flow_version_list'\ ':branch-name:__git_branch_names' ;; (finish) _arguments \ -F'[Fetch from origin before performing finish]' \ -s'[Sign the release tag cryptographically]'\ -u'[Use the given GPG-key for the digital signature (implies -s)]'\ -m'[Use the given tag message]'\ -p'[Push to $ORIGIN after performing finish]'\ ':hotfix:__git_flow_hotfix_list' ;; (delete) _arguments \ -f'[Force deletion]' \ -r'[Delete remote branch]' \ ':hotfix:__git_flow_hotfix_list' ;; (rebase) _arguments \ -i'[Do an interactive rebase]' \ ':branch:__git_branch_names' ;; *) _arguments \ -v'[Verbose (more) output]' ;; esac ;; esac } __git-flow-feature () { local curcontext="$curcontext" state line typeset -A opt_args _arguments -C \ ':command:->command' \ '*::options:->options' case $state in (command) local -a subcommands subcommands=( 'start:Start a new feature branch.' 'finish:Finish a feature branch.' 'delete:Delete a feature branch.' 'list:List all your feature branches. (Alias to `git flow feature`)' 'publish:Publish feature branch to remote.' 'track:Checkout remote feature branch.' 'diff:Show all changes.' 'rebase:Rebase from integration branch.' 'checkout:Checkout local feature branch.' 'pull:Pull changes from remote.' 'rename:Rename a feature branch.' ) _describe -t commands 'git flow feature' subcommands _arguments \ -v'[Verbose (more) output]' ;; (options) case $line[1] in (start) _arguments \ -F'[Fetch from origin before performing finish]'\ ':feature:__git_flow_feature_list'\ ':branch-name:__git_branch_names' ;; (finish) _arguments \ -F'[Fetch from origin before performing finish]' \ -r'[Rebase instead of merge]'\ ':feature:__git_flow_feature_list' ;; (delete) _arguments \ -f'[Force deletion]' \ -r'[Delete remote branch]' \ ':feature:__git_flow_feature_list' ;; (publish) _arguments \ ':feature:__git_flow_feature_list'\ ;; (track) _arguments \ ':feature:__git_flow_feature_list'\ ;; (diff) _arguments \ ':branch:__git_branch_names'\ ;; (rebase) _arguments \ -i'[Do an interactive rebase]' \ ':branch:__git_branch_names' ;; (checkout) _arguments \ ':branch:__git_flow_feature_list'\ ;; (pull) _arguments \ ':remote:__git_remotes'\ ':branch:__git_branch_names' ;; *) _arguments \ -v'[Verbose (more) output]' ;; esac ;; esac } __git-flow-bugfix () { local curcontext="$curcontext" state line typeset -A opt_args _arguments -C \ ':command:->command' \ '*::options:->options' case $state in (command) local -a subcommands subcommands=( 'start:Start a new bugfix branch.' 'finish:Finish a bugfix branch.' 'delete:Delete a bugfix branch.' 'list:List all your bugfix branches. (Alias to `git flow bugfix`)' 'publish:Publish bugfix branch to remote.' 'track:Checkout remote bugfix branch.' 'diff:Show all changes.' 'rebase:Rebase from integration branch.' 'checkout:Checkout local bugfix branch.' 'pull:Pull changes from remote.' 'rename:Rename a bugfix branch.' ) _describe -t commands 'git flow bugfix' subcommands _arguments \ -v'[Verbose (more) output]' ;; (options) case $line[1] in (start) _arguments \ -F'[Fetch from origin before performing finish]'\ ':bugfix:__git_flow_bugfix_list'\ ':branch-name:__git_branch_names' ;; (finish) _arguments \ -F'[Fetch from origin before performing finish]' \ -r'[Rebase instead of merge]'\ ':bugfix:__git_flow_bugfix_list' ;; (delete) _arguments \ -f'[Force deletion]' \ -r'[Delete remote branch]' \ ':bugfix:__git_flow_bugfix_list' ;; (publish) _arguments \ ':bugfix:__git_flow_bugfix_list'\ ;; (track) _arguments \ ':bugfix:__git_flow_bugfix_list'\ ;; (diff) _arguments \ ':branch:__git_branch_names'\ ;; (rebase) _arguments \ -i'[Do an interactive rebase]' \ ':branch:__git_branch_names' ;; (checkout) _arguments \ ':branch:__git_flow_bugfix_list'\ ;; (pull) _arguments \ ':remote:__git_remotes'\ ':branch:__git_branch_names' ;; *) _arguments \ -v'[Verbose (more) output]' ;; esac ;; esac } __git-flow-config () { local curcontext="$curcontext" state line typeset -A opt_args _arguments -C \ ':command:->command' \ '*::options:->options' case $state in (command) local -a subcommands subcommands=( 'list:List the configuration. (Alias to `git flow config`)' 'set:Set the configuration option' ) _describe -t commands 'git flow config' subcommands ;; (options) case $line[1] in (set) _arguments \ --local'[Use repository config file]' \ --global'[Use global config file]'\ --system'[Use system config file]'\ --file'[Use given config file]'\ ':option:(master develop feature hotfix release support versiontagprefix)' ;; *) _arguments \ --local'[Use repository config file]' \ --global'[Use global config file]'\ --system'[Use system config file]'\ --file'[Use given config file]' ;; esac ;; esac } __git_flow_version_list () { local expl declare -a versions versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}}) __git_command_successful || return _wanted versions expl 'version' compadd $versions } __git_flow_feature_list () { local expl declare -a features features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}}) __git_command_successful || return _wanted features expl 'feature' compadd $features } __git_flow_bugfix_list () { local expl declare -a bugfixes bugfixes=(${${(f)"$(_call_program bugfixes git flow bugfix list 2> /dev/null | tr -d ' |*')"}}) __git_command_successful || return _wanted bugfixes expl 'bugfix' compadd $bugfixes } __git_remotes () { local expl gitdir remotes gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null) __git_command_successful || return remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]}) __git_command_successful || return # TODO: Should combine the two instead of either or. if (( $#remotes > 0 )); then _wanted remotes expl remote compadd $* - $remotes else _wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*" fi } __git_flow_hotfix_list () { local expl declare -a hotfixes hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}}) __git_command_successful || return _wanted hotfixes expl 'hotfix' compadd $hotfixes } __git_branch_names () { local expl declare -a branch_names branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/}) __git_command_successful || return _wanted branch-names expl branch-name compadd $* - $branch_names } __git_command_successful () { if (( ${#pipestatus:#0} > 0 )); then _message 'not a git repository' return 1 fi return 0 } zstyle ':completion:*:*:git:*' user-commands flow:'provide high-level repository operations' git-flow-completion-0.6.0/git.fish000066400000000000000000000257311310771356400170710ustar00rootroot00000000000000#!fish # # git-flow-completion # =================== # # Fish completion support for [git-flow (AVH Edition)](http://github.com/petervanderdoes/gitflow) # # The contained completion routines provide support for completing: # # * git-flow init and version # * feature, hotfix and release branches # * remote feature, hotfix and release branch names # # # Installation # ------------ # # To achieve git-flow completion nirvana: # # 1. Install this file in your `~/.config/fish/completions` folder. # # # The Fine Print # -------------- # Author: # Copyright 2012 Peter van der Does. # # Original Author: # Copyright (c) 2012 [Justin Hileman](http://justinhileman.com) # # Distributed under the [MIT License](http://creativecommons.org/licenses/MIT/) for prefix in /usr /usr/local if test -f $prefix/share/fish/completions/git.fish . $prefix/share/fish/completions/git.fish break end end if not functions -q __fish_git_branches echo \nError: git completion not found >&2 exit end ## Support functions function __fish_git_flow_using_command set cmd (commandline -opc) set subcommands 'flow' $argv if [ (count $cmd) = (math (count $subcommands) + 1) ] for i in (seq (count $subcommands)) if not test $subcommands[$i] = $cmd[(math $i + 1)] return 1 end end return 0 end return 1 end function __fish_git_flow_prefix git config "gitflow.prefix.$argv[1]" 2> /dev/null; or echo "$argv[1]/" end function __fish_git_flow_branches set prefix (__fish_git_flow_prefix $argv[1]) __fish_git_branches | grep "^$prefix" | sed "s,^$prefix,," | sort end function __fish_git_flow_remote_branches set prefix (__fish_git_flow_prefix $argv[1]) set origin (git config gitflow.origin 2> /dev/null; or echo "origin") git branch -r 2> /dev/null | sed "s/^ *//g" | grep "^$origin/$prefix" | sed "s,^$origin/$prefix,," | sort end function __fish_git_flow_untracked_branches set branches (__fish_git_flow_branches $argv[1]) for branch in (__fish_git_flow_remote_branches $argv[1]) if not contains $branch $branches echo $branch end end end function __fish_git_flow_unpublished_branches set branches (__fish_git_flow_remote_branches $argv[1]) for branch in (__fish_git_flow_branches $argv[1]) if not contains $branch $branches echo $branch end end end ## git-flow complete -f -c git -n '__fish_git_needs_command' -a flow -d 'Manage a git-flow enabled repository' complete -f -c git -n '__fish_git_flow_using_command' -a version -d 'Show version information' ## git-flow init complete -f -c git -n '__fish_git_flow_using_command' -a init -d 'Initialize a new git repo with support for the branching model' complete -f -c git -n '__fish_git_flow_using_command init' -s f -d 'Force reinitialization' complete -f -c git -n '__fish_git_flow_using_command init' -s d -d 'Use default branch names' ## git-flow feature complete -f -c git -n '__fish_git_flow_using_command' -a feature -d 'Manage feature branches' complete -f -c git -n '__fish_git_flow_using_command feature' -a list -d 'List feature branches' complete -f -c git -n '__fish_git_flow_using_command feature' -s v -d 'Verbose output' complete -f -c git -n '__fish_git_flow_using_command feature' -a start -d 'Start a new feature branch' complete -f -c git -n '__fish_git_flow_using_command feature start' -s F -d 'Fetch from origin first' complete -f -c git -n '__fish_git_flow_using_command feature' -a finish -d 'Finish a feature branch' complete -f -c git -n '__fish_git_flow_using_command feature finish' -s F -d 'Fetch from origin first' complete -f -c git -n '__fish_git_flow_using_command feature finish' -s r -d 'Rebase instead of merging' complete -f -c git -n '__fish_git_flow_using_command feature finish' -a '(__fish_git_flow_branches feature)' -d 'Feature branch' complete -f -c git -n '__fish_git_flow_using_command feature' -a delete -d 'Delete a feature branch' complete -f -c git -n '__fish_git_flow_using_command feature delete' -s f -d 'Force deletion' complete -f -c git -n '__fish_git_flow_using_command feature delete' -s r -d 'Delete remote branch' complete -f -c git -n '__fish_git_flow_using_command feature delete' -a '(__fish_git_flow_branches feature)' -d 'Feature branch' complete -f -c git -n '__fish_git_flow_using_command feature' -a publish -d 'Publish a feature branch to remote' complete -f -c git -n '__fish_git_flow_using_command feature publish' -a '(__fish_git_flow_unpublished_branches feature)' -d 'Feature branch' complete -f -c git -n '__fish_git_flow_using_command feature' -a track -d 'Checkout remote feature branch' complete -f -c git -n '__fish_git_flow_using_command feature track' -a '(__fish_git_flow_untracked_branches feature)' -d 'Feature branch' complete -f -c git -n '__fish_git_flow_using_command feature' -a diff -d 'Show all changes' complete -f -c git -n '__fish_git_flow_using_command feature' -a rebase -d 'Rebase against integration branch' complete -f -c git -n '__fish_git_flow_using_command feature rebase' -s i -d 'Do an interactive rebase' complete -f -c git -n '__fish_git_flow_using_command feature' -a checkout -d 'Checkout local feature branch' complete -f -c git -n '__fish_git_flow_using_command feature checkout' -a '(__fish_git_flow_branches feature)' -d 'Feature branch' complete -f -c git -n '__fish_git_flow_using_command feature' -a pull -d 'Pull changes from remote' complete -f -c git -n '__fish_git_flow_using_command feature pull' -a '(__fish_git_remotes)' -d 'Remote' ## git-flow release complete -f -c git -n '__fish_git_flow_using_command' -a release -d 'Manage release branches' complete -f -c git -n '__fish_git_flow_using_command release' -a list -d 'List release branches' complete -f -c git -n '__fish_git_flow_using_command release' -s v -d 'Verbose output' complete -f -c git -n '__fish_git_flow_using_command release' -a start -d 'Start a new release branch' complete -f -c git -n '__fish_git_flow_using_command release start' -s F -d 'Fetch from origin first' complete -f -c git -n '__fish_git_flow_using_command release' -a finish -d 'Finish a release branch' complete -f -c git -n '__fish_git_flow_using_command release finish' -s F -d 'Fetch from origin first' complete -f -c git -n '__fish_git_flow_using_command release finish' -s s -d 'Sign the release tag cryptographically' complete -f -c git -n '__fish_git_flow_using_command release finish' -s u -d 'Use the given GPG-key for the digital signature (implies -s)' complete -f -c git -n '__fish_git_flow_using_command release finish' -s m -d 'Use the given tag message' complete -f -c git -n '__fish_git_flow_using_command release finish' -s p -d 'Push to $ORIGIN after performing finish' complete -f -c git -n '__fish_git_flow_using_command release finish' -a '(__fish_git_flow_branches release)' -d 'Release branch' complete -f -c git -n '__fish_git_flow_using_command release' -a delete -d 'Delete a feature branch' complete -f -c git -n '__fish_git_flow_using_command release delete' -s f -d 'Force deletion' complete -f -c git -n '__fish_git_flow_using_command release delete' -s r -d 'Delete remote branch' complete -f -c git -n '__fish_git_flow_using_command release delete' -a '(__fish_git_flow_branches release)' -d 'Release branch' complete -f -c git -n '__fish_git_flow_using_command release' -a publish -d 'Publish a release branch to remote' complete -f -c git -n '__fish_git_flow_using_command release publish' -a '(__fish_git_flow_unpublished_branches release)' -d 'Release branch' complete -f -c git -n '__fish_git_flow_using_command release' -a track -d 'Checkout remote release branch' complete -f -c git -n '__fish_git_flow_using_command release track' -a '(__fish_git_flow_untracked_branches release)' -d 'Release branch' ## git-flow hotfix complete -f -c git -n '__fish_git_flow_using_command' -a hotfix -d 'Manage hotfix branches' complete -f -c git -n '__fish_git_flow_using_command hotfix' -a list -d 'List hotfix branches' complete -f -c git -n '__fish_git_flow_using_command hotfix' -s v -d 'Verbose output' complete -f -c git -n '__fish_git_flow_using_command hotfix' -a start -d 'Start a new hotfix branch' complete -f -c git -n '__fish_git_flow_using_command hotfix start' -s F -d 'Fetch from origin first' complete -f -c git -n '__fish_git_flow_using_command hotfix' -a finish -d 'Finish a hotfix branch' complete -f -c git -n '__fish_git_flow_using_command hotfix finish' -s F -d 'Fetch from origin first' complete -f -c git -n '__fish_git_flow_using_command hotfix finish' -s s -d 'Sign the hotfix tag cryptographically' complete -f -c git -n '__fish_git_flow_using_command hotfix finish' -s u -d 'Use the given GPG-key for the digital signature (implies -s)' complete -f -c git -n '__fish_git_flow_using_command hotfix finish' -s m -d 'Use the given tag message' complete -f -c git -n '__fish_git_flow_using_command hotfix finish' -s p -d 'Push to $ORIGIN after performing finish' complete -f -c git -n '__fish_git_flow_using_command hotfix finish' -a '(__fish_git_flow_branches hotfix)' -d 'Hotfix branch' complete -f -c git -n '__fish_git_flow_using_command hotfix' -a delete -d 'Delete a feature branch' complete -f -c git -n '__fish_git_flow_using_command hotfix delete' -s f -d 'Force deletion' complete -f -c git -n '__fish_git_flow_using_command hotfix delete' -s r -d 'Delete remote branch' complete -f -c git -n '__fish_git_flow_using_command hotfix delete' -a '(__fish_git_flow_branches hotfix)' -d 'Hotfix branch' ## git-flow support complete -f -c git -n '__fish_git_flow_using_command' -a support -d 'Manage support branches' complete -f -c git -n '__fish_git_flow_using_command support' -a list -d 'List support branches' complete -f -c git -n '__fish_git_flow_using_command support' -s v -d 'Verbose output' complete -f -c git -n '__fish_git_flow_using_command support' -a start -d 'Start a new support branch' complete -f -c git -n '__fish_git_flow_using_command support start' -s F -d 'Fetch from origin first' ## git-flow config complete -f -c git -n '__fish_git_flow_using_command' -a config -d 'Manage configuration' complete -f -c git -n '__fish_git_flow_using_command config' -a list -d 'List configuration' complete -f -c git -n '__fish_git_flow_using_command config list' -l local -d 'Use repository config file' complete -f -c git -n '__fish_git_flow_using_command config list' -l global -d 'Use global config file' complete -f -c git -n '__fish_git_flow_using_command config list' -l system -d 'Use system config file' complete -f -c git -n '__fish_git_flow_using_command config list' -l file -d 'Use given config file' complete -f -c git -n '__fish_git_flow_using_command config' -a set -d 'Set configuration option' complete -f -c git -n '__fish_git_flow_using_command config start' -l local -d 'Use repository config file' complete -f -c git -n '__fish_git_flow_using_command config start' -l global -d 'Use global config file' complete -f -c git -n '__fish_git_flow_using_command config start' -l system -d 'Use system config file' complete -f -c git -n '__fish_git_flow_using_command config start' -l file -d 'Use given config file'