X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=contrib%2Fcompletion%2Fgit-completion.bash;h=1b589fadbb5dd94827cf1565bce232d0f3a3c42a;hb=908535c1fa1c5cddddfa74732c66d625e99bd6b0;hp=893b7716cafa4811d237480a980140d308aa20dc;hpb=a62bbf8f01c6b19cd1a5cf92a98f612176aa2b67;p=git.git diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 893b7716c..1b589fadb 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -246,6 +246,8 @@ __git_ps1 () fi elif [ -f "$g/MERGE_HEAD" ]; then r="|MERGING" + elif [ -f "$g/CHERRY_PICK_HEAD" ]; then + r="|CHERRY-PICKING" elif [ -f "$g/BISECT_LOG" ]; then r="|BISECTING" fi @@ -662,11 +664,14 @@ __git_compute_merge_strategies () : ${__git_merge_strategies:=$(__git_list_merge_strategies)} } -__git_complete_file () +__git_complete_revlist_file () { local pfx ls ref cur _get_comp_words_by_ref -n =: cur case "$cur" in + *..?*:*) + return + ;; ?*:*) ref="${cur%%:*}" cur="${cur#*:}" @@ -680,7 +685,7 @@ __git_complete_file () *) ls="$ref" ;; - esac + esac case "$COMP_WORDBREAKS" in *:*) : great ;; @@ -705,17 +710,6 @@ __git_complete_file () s/^.* //')" \ -- "$cur")) ;; - *) - __gitcomp "$(__git_refs)" - ;; - esac -} - -__git_complete_revlist () -{ - local pfx cur - _get_comp_words_by_ref -n =: cur - case "$cur" in *...*) pfx="${cur%...*}..." cur="${cur#*...}" @@ -732,6 +726,17 @@ __git_complete_revlist () esac } + +__git_complete_file () +{ + __git_complete_revlist_file +} + +__git_complete_revlist () +{ + __git_complete_revlist_file +} + __git_complete_remote_or_refspec () { local cur words cword @@ -1354,11 +1359,11 @@ _git_diff () return ;; esac - __git_complete_file + __git_complete_revlist_file } __git_mergetools_common="diffuse ecmerge emerge kdiff3 meld opendiff - tkdiff vimdiff gvimdiff xxdiff araxis p4merge + tkdiff vimdiff gvimdiff xxdiff araxis p4merge bc3 " _git_difftool () @@ -1506,7 +1511,7 @@ _git_help () ;; esac __git_compute_all_commands - __gitcomp "$__git_all_commands + __gitcomp "$__git_all_commands $(__git_aliases) attributes cli core-tutorial cvs-migration diffcore gitk glossary hooks ignore modules repository-layout tutorial tutorial-2