summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 05d3951)
raw | patch | inline | side by side (parent: 05d3951)
author | Todd Zullinger <tmz@pobox.com> | |
Fri, 11 Sep 2009 23:23:45 +0000 (19:23 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 13 Sep 2009 20:40:25 +0000 (13:40 -0700) |
James Bardin noted that the completion spewed warnings when no git config
file is present. This is likely a bug to be fixed in git config, but it's
also good to simplify the completion code by using the --get-regexp option
as Jeff King pointed out.
Signed-off-by: Todd Zullinger <tmz@pobox.com>
Trivially-acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
file is present. This is likely a bug to be fixed in git config, but it's
also good to simplify the completion code by using the --get-regexp option
as Jeff King pointed out.
Signed-off-by: Todd Zullinger <tmz@pobox.com>
Trivially-acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash | patch | blob | history |
index 98592040d1bb38c2c6a3e918dc992eb60532f41c..2d2d5794ad3a5c5365a4242b1b1e4e67a99dc9ac 100755 (executable)
echo ${i#$d/remotes/}
done
[ "$ngoff" ] && shopt -u nullglob
- for i in $(git --git-dir="$d" config --list); do
- case "$i" in
- remote.*.url=*)
- i="${i#remote.}"
- echo "${i/.url=*/}"
- ;;
- esac
+ for i in $(git --git-dir="$d" config --get-regexp 'remote\..*\.url' 2>/dev/null); do
+ i="${i#remote.}"
+ echo "${i/.url*/}"
done
}
__git_aliases ()
{
local i IFS=$'\n'
- for i in $(git --git-dir="$(__gitdir)" config --list); do
- case "$i" in
- alias.*)
- i="${i#alias.}"
- echo "${i/=*/}"
- ;;
- esac
+ for i in $(git --git-dir="$(__gitdir)" config --get-regexp "alias\..*" 2>/dev/null); do
+ i="${i#alias.}"
+ echo "${i/ */}"
done
}
;;
update)
local i c='' IFS=$'\n'
- for i in $(git --git-dir="$(__gitdir)" config --list); do
- case "$i" in
- remotes.*)
- i="${i#remotes.}"
- c="$c ${i/=*/}"
- ;;
- esac
+ for i in $(git --git-dir="$(__gitdir)" config --get-regexp "remotes\..*" 2>/dev/null); do
+ i="${i#remotes.}"
+ c="$c ${i/ */}"
done
__gitcomp "$c"
;;