diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-03-22 21:37:47 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-03-22 21:37:47 -0700 |
commit | 1c92e394468c927f129c8f2a138b760f884e3bed (patch) | |
tree | 23a2dd65fd4e8c2ace03e9490411133f482f85c8 | |
parent | Merge branch 'svn-fe' of git://repo.or.cz/git/jrn (diff) | |
parent | bash: complete 'git diff ...branc<TAB>' (diff) | |
download | tgif-1c92e394468c927f129c8f2a138b760f884e3bed.tar.xz |
Merge branch 'sg/complete-symmetric-diff'
* sg/complete-symmetric-diff:
bash: complete 'git diff ...branc<TAB>'
bash: fix misindented esac statement in __git_complete_file()
-rwxr-xr-x | contrib/completion/git-completion.bash | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index ccdc172a06..3b1cc83e2d 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,7 +1359,7 @@ _git_diff () return ;; esac - __git_complete_file + __git_complete_revlist_file } __git_mergetools_common="diffuse ecmerge emerge kdiff3 meld opendiff |