summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dd787c1)
raw | patch | inline | side by side (parent: dd787c1)
author | Stephen Boyd <bebarino@gmail.com> | |
Tue, 30 Jun 2009 05:08:38 +0000 (22:08 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 6 Jul 2009 16:45:00 +0000 (09:45 -0700) |
Commit 0065236 (bash completion: complete variable names for "git
config" with options 2009-05-08) implemented its config variable search
wrong. When a config contains a value with a space and a period (.) in
it, completion erroneously thinks that line in the configuration is
multiple config variables.
For example
$ cat .git/config
format.cc = Junio C Hamano <gitster@pobox.com>
$ git config --unset <TAB>
format.cc
<gitster@pobox.com>
Instead of using a for loop splitting across spaces, pipe each line to a
while read loop and beef up the case statement to match only
'config.variable=value'.
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
config" with options 2009-05-08) implemented its config variable search
wrong. When a config contains a value with a space and a period (.) in
it, completion erroneously thinks that line in the configuration is
multiple config variables.
For example
$ cat .git/config
format.cc = Junio C Hamano <gitster@pobox.com>
$ git config --unset <TAB>
format.cc
<gitster@pobox.com>
Instead of using a for loop splitting across spaces, pipe each line to a
while read loop and beef up the case statement to match only
'config.variable=value'.
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash | patch | blob | history |
index 1f44ec209234affa214af307c8e2c86c2847073e..9c488646d04f9fa08d9b2f2445b2a83d9bc4de40 100755 (executable)
c=$((--c))
done
- for i in $(git --git-dir="$(__gitdir)" config $config_file --list \
- 2>/dev/null); do
- case "$i" in
- *.*)
- echo "${i/=*/}"
+ git --git-dir="$(__gitdir)" config $config_file --list 2>/dev/null |
+ while read line
+ do
+ case "$line" in
+ *.*=*)
+ echo "${line/=*/}"
;;
esac
done