From: Junio C Hamano Date: Mon, 31 Oct 2011 02:13:13 +0000 (-0700) Subject: Merge branch 'jk/git-tricks' X-Git-Tag: v1.7.8-rc0~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/324bc2a7ee1cffbf959652a54f4d3d59a1173104?ds=inline;hp=-c 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 --- 324bc2a7ee1cffbf959652a54f4d3d59a1173104 diff --combined contrib/completion/git-completion.bash index fc3d0b1a06,af283cb73b..98af8f5c7e --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@@ -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) @@@ -126,7 -125,7 +126,7 @@@ 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 @@@ -1452,6 -1455,15 +1456,15 @@@ ;; esac + case "$cword,$prev" in + 2,*|*,-*) + if test -r tags; then + __gitcomp "$(__git_match_ctag "$cur" tags)" + return + fi + ;; + esac + __gitcomp "$(__git_refs)" }