8ace453f37acf0568bdb2e40920edb7598ad873a

Author
kang <yi1115610574@gmail.com>
Committer
Carlo Sala <carlosalag@protonmail.com>
Date

Message

feat(git-extras): update completion (2023-06-19 3a258cb)

Closes #11712

Diff

This diff is truncated to protect this page.

  1diff --git a/plugins/git-extras/git-extras.plugin.zsh b/plugins/git-extras/git-extras.plugin.zsh
  2index 6b96e12af7e0fd442dcbf3fbd304ffc8fcea77db..f5fd387d114728780663d8ec366f361137e8f723 100644
  3--- a/plugins/git-extras/git-extras.plugin.zsh
  4+++ b/plugins/git-extras/git-extras.plugin.zsh
  5@@ -80,22 +80,10 @@ __gitex_specific_branch_names() {
  6     _wanted branch-names expl branch-name compadd - $branch_names
  7 }
  8 
  9-__gitex_chore_branch_names() {
 10-    __gitex_specific_branch_names 'chore'
 11-}
 12-
 13 __gitex_feature_branch_names() {
 14     __gitex_specific_branch_names 'feature'
 15 }
 16 
 17-__gitex_refactor_branch_names() {
 18-    __gitex_specific_branch_names 'refactor'
 19-}
 20-
 21-__gitex_bug_branch_names() {
 22-    __gitex_specific_branch_names 'bug'
 23-}
 24-
 25 __gitex_submodule_names() {
 26     local expl
 27     declare -a submodule_names
 28@@ -114,88 +102,29 @@ __gitex_author_names() {
 29 }
 30 
 31 # subcommands
 32+# new subcommand should be added in alphabetical order
 33 _git-authors() {
 34     _arguments  -C \
 35         '(--list -l)'{--list,-l}'[show authors]' \
 36         '--no-email[without email]' \
 37 }
 38 
 39-_git-bug() {
 40-    local curcontext=$curcontext state line ret=1
 41-    declare -A opt_args
 42-
 43-    _arguments -C \
 44-        ': :->command' \
 45-        '*:: :->option-or-argument' && ret=0
 46-
 47-    case $state in
 48-        (command)
 49-            declare -a commands
 50-            commands=(
 51-                'finish:merge bug into the current branch'
 52-            )
 53-            _describe -t commands command commands && ret=0
 54-            ;;
 55-        (option-or-argument)
 56-            curcontext=${curcontext%:*}-$line[1]:
 57-            case $line[1] in
 58-                (finish)
 59-                    _arguments -C \
 60-                        ':branch-name:__gitex_bug_branch_names'
 61-                    ;;
 62-                -r|--remote )
 63-                    _arguments -C \
 64-                        ':remote-name:__gitex_remote_names'
 65-                    ;;
 66-            esac
 67-            return 0
 68-    esac
 69-
 70-    _arguments \
 71-        '(--remote -r)'{--remote,-r}'[setup remote tracking branch]'
 72-}
 73-
 74-
 75 _git-changelog() {
 76     _arguments \
 77         '(-l --list)'{-l,--list}'[list commits]' \
 78 }
 79 
 80-_git-chore() {
 81-    local curcontext=$curcontext state line ret=1
 82-    declare -A opt_args
 83-
 84-    _arguments -C \
 85-        ': :->command' \
 86-        '*:: :->option-or-argument' && ret=0
 87-
 88-    case $state in
 89-        (command)
 90-            declare -a commands
 91-            commands=(
 92-                'finish:merge and delete the chore branch'
 93-            )
 94-            _describe -t commands command commands && ret=0
 95-            ;;
 96-        (option-or-argument)
 97-            curcontext=${curcontext%:*}-$line[1]:
 98-            case $line[1] in
 99-                (finish)
100-                    _arguments -C \
101-                        ':branch-name:__gitex_chore_branch_names'
102-                    ;;
103-                -r|--remote )
104-                    _arguments -C \