Merge branch 'mk/grep-pcre'
[gitweb.git] / contrib / completion / git-completion.bash
index 70897b30260cb449bcd7918f9c8542a433fb2f36..b36290fa6015d9b66dc6a5891ff12f85f279a1c3 100755 (executable)
@@ -1441,8 +1441,9 @@ _git_grep ()
                __gitcomp "
                        --cached
                        --text --ignore-case --word-regexp --invert-match
-                       --full-name
+                       --full-name --line-number
                        --extended-regexp --basic-regexp --fixed-strings
+                       --perl-regexp
                        --files-with-matches --name-only
                        --files-without-match
                        --max-depth
@@ -1534,7 +1535,7 @@ __git_log_common_options="
 __git_log_gitk_options="
        --dense --sparse --full-history
        --simplify-merges --simplify-by-decoration
-       --left-right
+       --left-right --notes --no-notes
 "
 # Options that go well for log and shortlog (not gitk)
 __git_log_shortlog_options="
@@ -2608,11 +2609,13 @@ _git ()
        if [[ -n ${ZSH_VERSION-} ]]; then
                emulate -L bash
                setopt KSH_TYPESET
-       else
-               local words
+
+               # workaround zsh's bug that leaves 'words' as a special
+               # variable in versions < 4.3.12
+               typeset -h words
        fi
 
-       local cur cword prev
+       local cur words cword prev
        _get_comp_words_by_ref -n =: cur words cword prev
        while [ $c -lt $cword ]; do
                i="${words[c]}"
@@ -2661,11 +2664,13 @@ _gitk ()
        if [[ -n ${ZSH_VERSION-} ]]; then
                emulate -L bash
                setopt KSH_TYPESET
-       else
-               local words
+
+               # workaround zsh's bug that leaves 'words' as a special
+               # variable in versions < 4.3.12
+               typeset -h words
        fi
 
-       local cur cword prev
+       local cur words cword prev
        _get_comp_words_by_ref -n =: cur words cword prev
 
        __git_has_doubledash && return