diff options
Diffstat (limited to 'bash/bash_completion.d/git.bash')
-rw-r--r-- | bash/bash_completion.d/git.bash | 39 |
1 files changed, 8 insertions, 31 deletions
diff --git a/bash/bash_completion.d/git.bash b/bash/bash_completion.d/git.bash index bde515ee..2bee169a 100644 --- a/bash/bash_completion.d/git.bash +++ b/bash/bash_completion.d/git.bash @@ -69,23 +69,6 @@ _git() { done return ;; - - # Untracked files - untracked_files) - local file - while IFS= read -rd '' file ; do - [[ -n $file ]] || continue - COMPREPLY[${#COMPREPLY[@]}]=$file - done < <(git ls-files \ - --directory \ - --exclude-standard \ - --no-empty-directory \ - --others \ - -z \ - -- "${COMP_WORDS[COMP_CWORD]}"'*' \ - 2>/dev/null) - return - ;; esac # Try to find the index of the Git subcommand @@ -109,23 +92,17 @@ _git() { # Complete initial subcommand or alias if ((sci == COMP_CWORD)) ; then - _git subcommands - _git aliases + "${FUNCNAME[0]}" subcommands + "${FUNCNAME[0]}" aliases return fi # Test subcommand to choose completions case ${COMP_WORDS[sci]} in - # Complete with untracked, unignored files - add) - _git untracked_files - return - ;; - # Help on real subcommands (not aliases) help) - _git subcommands + "${FUNCNAME[0]}" subcommands return ;; @@ -149,7 +126,7 @@ _git() { update ' -- "${COMP_WORDS[COMP_CWORD]}") else - _git remotes + "${FUNCNAME[0]}" remotes fi return ;; @@ -199,15 +176,15 @@ _git() { # Complete with remotes and then refs fetch|pull|push) if ((COMP_CWORD == 2)) ; then - _git remotes + "${FUNCNAME[0]}" remotes else - _git refs + "${FUNCNAME[0]}" refs fi ;; # Commands for which I'm likely to want a ref branch|checkout|merge|rebase|tag) - _git refs + "${FUNCNAME[0]}" refs ;; # I normally only want a refspec for "reset" if I'm using the --hard or @@ -215,7 +192,7 @@ _git() { reset) case ${COMP_WORDS[COMP_CWORD-1]} in --hard|--soft) - _git refs + "${FUNCNAME[0]}" refs ;; esac ;; |