summaryrefslogtreecommitdiff
path: root/contrib/completion
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-10-30 19:13:13 -0700
committerJunio C Hamano <gitster@pobox.com>2011-10-30 19:13:13 -0700
commit324bc2a7ee1cffbf959652a54f4d3d59a1173104 (patch)
tree7727e9a761d04222c0bb19e18b1d58053710d7d2 /contrib/completion
parente8e1c29021da446d0c50573ef9619bf74f515c20 (diff)
parent29eec71f21853f2428cdae83d6b04d4ae1084b7d (diff)
downloadgit-324bc2a7ee1cffbf959652a54f4d3d59a1173104.tar.gz
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')
-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)"
}