2 # ------------------------------------------------------------------------------
6 # Completion script for git-extras (http://github.com/visionmedia/git-extras).
8 # ------------------------------------------------------------------------------
12 # * Alexis GRIMALDI (https://github.com/agrimaldi)
14 # ------------------------------------------------------------------------------
18 # * git-extras (http://github.com/visionmedia/git-extras)
19 # * git-flow-completion (http://github.com/bobthecow/git-flow-completion)
21 # ------------------------------------------------------------------------------
24 __git_command_successful
() {
25 if (( ${#pipestatus:#0} > 0 )); then
26 _message
'not a git repository'
36 tag_names
=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/tags 2>/dev/null)"}#refs/tags/})
37 __git_command_successful
|| return
38 _wanted tag-names expl tag-name compadd $
* - $tag_names
42 __git_branch_names
() {
44 declare -a branch_names
45 branch_names
=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
46 __git_command_successful
|| return
47 _wanted branch-names expl branch-name compadd $
* - $branch_names
51 __git_feature_branch_names
() {
53 declare -a branch_names
54 branch_names
=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/feature 2>/dev/null)"}#refs/heads/feature/})
55 __git_command_successful
|| return
56 _wanted branch-names expl branch-name compadd $
* - $branch_names
60 __git_refactor_branch_names
() {
62 declare -a branch_names
63 branch_names
=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/refactor 2>/dev/null)"}#refs/heads/refactor/})
64 __git_command_successful
|| return
65 _wanted branch-names expl branch-name compadd $
* - $branch_names
69 __git_bug_branch_names
() {
71 declare -a branch_names
72 branch_names
=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/bug 2>/dev/null)"}#refs/heads/bug/})
73 __git_command_successful
|| return
74 _wanted branch-names expl branch-name compadd $
* - $branch_names
78 __git_submodule_names
() {
80 declare -a submodule_names
81 submodule_names
=(${(f)"$(_call_program branchrefs git submodule status | awk '{print $2}')"})
82 __git_command_successful || return
83 _wanted submodule-names expl submodule-name compadd $* - $submodule_names
87 __git_author_names() {
89 declare -a author_names
Reading blob failed.