summaryrefslogtreecommitdiff
path: root/contrib/completion/git-completion.bash
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2011-10-30 19:13:13 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-10-30 19:13:13 -0700
commit324bc2a7ee1cffbf959652a54f4d3d59a1173104 (patch)
tree7727e9a761d04222c0bb19e18b1d58053710d7d2 /contrib/completion/git-completion.bash
parentUpdate draft release notes to 1.7.8 (diff)
parentcompletion: match ctags symbol names in grep patterns (diff)
downloadtgif-324bc2a7ee1cffbf959652a54f4d3d59a1173104.tar.xz
Merge branch 'jk/git-tricks'
* jk/git-tricks: completion: match ctags symbol names in grep patterns contrib: add git-jump script contrib: add diff highlight script
Diffstat (limited to 'contrib/completion/git-completion.bash')
-rwxr-xr-xcontrib/completion/git-completion.bash13
1 files changed, 13 insertions, 0 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index fc3d0b1a06..98af8f5c7e 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1430,6 +1430,10 @@ _git_gitk ()
_gitk
}
+__git_match_ctag() {
+ awk "/^${1////\\/}/ { print \$1 }" "$2"
+}
+
_git_grep ()
{
__git_has_doubledash && return
@@ -1452,6 +1456,15 @@ _git_grep ()
;;
esac
+ case "$cword,$prev" in
+ 2,*|*,-*)
+ if test -r tags; then
+ __gitcomp "$(__git_match_ctag "$cur" tags)"
+ return
+ fi
+ ;;
+ esac
+
__gitcomp "$(__git_refs)"
}