completion: mention the oldest version we need to support
[gitweb.git] / contrib / completion / git-completion.bash
index dc3ec43b652537c7dd61680b49a52df5be228349..d59b9bb4d8c0a028c5e4661227cd0d1bfbed8978 100644 (file)
@@ -29,6 +29,8 @@
 # tell the completion to use commit completion.  This also works with aliases
 # of form "!sh -c '...'".  For example, "!sh -c ': git commit ; ... '".
 #
+# Compatible with bash 3.2.57.
+#
 # You can set the following environment variables to influence the behavior of
 # the completion routines:
 #
@@ -280,6 +282,10 @@ __gitcomp ()
        esac
 }
 
+# Clear the variables caching builtins' options when (re-)sourcing
+# the completion script.
+unset $(set |sed -ne 's/^\(__gitcomp_builtin_[a-zA-Z0-9_][a-zA-Z0-9_]*\)=.*/\1/p') 2>/dev/null
+
 # This function is equivalent to
 #
 #    __gitcomp "$(git xxx --git-completion-helper) ..."
@@ -1815,7 +1821,7 @@ _git_name_rev ()
 
 _git_notes ()
 {
-       local subcommands='add append copy edit list prune remove show'
+       local subcommands='add append copy edit get-ref list merge prune remove show'
        local subcommand="$(__git_find_on_cmdline "$subcommands")"
 
        case "$subcommand,$cur" in
@@ -1838,7 +1844,7 @@ _git_notes ()
        *,--*)
                __gitcomp_builtin notes_$subcommand
                ;;
-       prune,*)
+       prune,*|get-ref,*)
                # this command does not take a ref, do not complete it
                ;;
        *)