Merge branch 'jk/git-tricks'
authorJunio C Hamano <gitster@pobox.com>
Mon, 31 Oct 2011 02:13:13 +0000 (19:13 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 31 Oct 2011 02:13:13 +0000 (19:13 -0700)
* jk/git-tricks:
completion: match ctags symbol names in grep patterns
contrib: add git-jump script
contrib: add diff highlight script

1  2 
contrib/completion/git-completion.bash
index fc3d0b1a0678ddf99c592959d2fe58c59543ec40,af283cb73b0b71490948f755c82339b688b77095..98af8f5c7ee68876e94194524cc0cda9d3f25345
@@@ -110,7 -110,6 +110,7 @@@ __git_ps1_show_upstream (
        local upstream=git legacy="" verbose=""
  
        # get some config options from git-config
 +      output="$(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')"
        while read key value; do
                case "$key" in
                bash.showupstream)
                        upstream=svn+git # default upstream is SVN if available, else git
                        ;;
                esac
 -      done < <(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')
 +      done <<< "$output"
  
        # parse configuration values
        for option in ${GIT_PS1_SHOWUPSTREAM}; do
@@@ -1430,6 -1429,10 +1430,10 @@@ _git_gitk (
        _gitk
  }
  
+ __git_match_ctag() {
+       awk "/^${1////\\/}/ { print \$1 }" "$2"
+ }
  _git_grep ()
  {
        __git_has_doubledash && return
                ;;
        esac
  
+       case "$cword,$prev" in
+       2,*|*,-*)
+               if test -r tags; then
+                       __gitcomp "$(__git_match_ctag "$cur" tags)"
+                       return
+               fi
+               ;;
+       esac
        __gitcomp "$(__git_refs)"
  }