X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=contrib%2Fcompletion%2Fgit-completion.bash;h=840ae38760a5de84b369b208a52cc579ce478378;hb=0f51322a6be0d31f299df7becad438e8edfb608b;hp=0b0b913d287f5d70f8f8fdce5f16335dd1c6f9ec;hpb=f4784b3eab2e12e7a8fda7431572753f3a970c63;p=git.git diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 0b0b913d2..840ae3876 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -664,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#*:}" @@ -682,7 +685,7 @@ __git_complete_file () *) ls="$ref" ;; - esac + esac case "$COMP_WORDBREAKS" in *:*) : great ;; @@ -707,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#*...}" @@ -734,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 @@ -1356,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 () @@ -1508,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 @@ -1574,6 +1577,8 @@ __git_log_common_options=" --max-count= --max-age= --since= --after= --min-age= --until= --before= + --min-parents= --max-parents= + --no-min-parents --no-max-parents " # Options that go well for log and gitk (not shortlog) __git_log_gitk_options="