completion: support 'git config --local'
authorMatthieu Moy <Matthieu.Moy@imag.fr>
Tue, 12 Feb 2013 12:20:42 +0000 (13:20 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 12 Feb 2013 18:06:25 +0000 (10:06 -0800)
This needs to be done in two places: __git_config_get_set_variables to
allow clever completion of "git config --local --get foo<tab>", and
_git_config to allow "git config --loc<tab>" to complete to --local.

While we're there, change the order of options in the code to match
git-config.txt.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash

index c8452fb163c6bf75f01ba8b06ded2b8d82143e21..059ba9d3e482c08434fb6860667179a6b73808cd 100644 (file)
@@ -1779,7 +1779,7 @@ __git_config_get_set_variables ()
        while [ $c -gt 1 ]; do
                word="${words[c]}"
                case "$word" in
-               --global|--system|--file=*)
+               --system|--global|--local|--file=*)
                        config_file="$word"
                        break
                        ;;
@@ -1885,7 +1885,7 @@ _git_config ()
        case "$cur" in
        --*)
                __gitcomp "
-                       --global --system --file=
+                       --system --global --local --file=
                        --list --replace-all
                        --get --get-all --get-regexp
                        --add --unset --unset-all