Merge branch 'jc/request-pull-show-head-4'
[gitweb.git] / contrib / completion / git-completion.bash
index 32df141f919fc48dd0310eabd4b510814f09f384..b7c1edf1cc763199d41a490b212a3b65ea581a86 100755 (executable)
@@ -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)"
 }