X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=contrib%2Fcompletion%2Fgit-completion.bash;h=7cf855746832b7400f9923297c4a0170cfacce36;hb=64fb90b7076eda54d894484ce34a91632997cd2b;hp=88b1b3c7a002323f696723c161d88d3dd9766a95;hpb=8fd2cfa7accd6b8f877014bf3e4bf8547b8e0d2a;p=git.git diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 88b1b3c7a..7cf855746 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -496,7 +496,7 @@ __git_all_commands () return fi local i IFS=" "$'\n' - for i in $(git help -a|egrep '^ ') + for i in $(git help -a|egrep '^ [a-zA-Z0-9]') do case $i in *--*) : helper pattern;; @@ -602,8 +602,12 @@ __git_aliases () { local i IFS=$'\n' for i in $(git --git-dir="$(__gitdir)" config --get-regexp "alias\..*" 2>/dev/null); do - i="${i#alias.}" - echo "${i/ */}" + case "$i" in + alias.*) + i="${i#alias.}" + echo "${i/ */}" + ;; + esac done } @@ -1794,6 +1798,11 @@ _git_remote () esac } +_git_replace () +{ + __gitcomp "$(__git_refs)" +} + _git_reset () { __git_has_doubledash && return @@ -2162,6 +2171,7 @@ _git () push) _git_push ;; rebase) _git_rebase ;; remote) _git_remote ;; + replace) _git_replace ;; reset) _git_reset ;; revert) _git_revert ;; rm) _git_rm ;;