diff options
author | Clint Adams <clint@users.sourceforge.net> | 2008-09-07 16:52:26 +0000 |
---|---|---|
committer | Clint Adams <clint@users.sourceforge.net> | 2008-09-07 16:52:26 +0000 |
commit | 07462f8303174f1118b1641b7a6520144e240ce7 (patch) | |
tree | 1bbf78fbebe53431cc4cd7c419ad49429b80a773 | |
parent | db31a13ecdd8306aad63319ace28bf7d029d4829 (diff) | |
download | zsh-07462f8303174f1118b1641b7a6520144e240ce7.tar.gz zsh-07462f8303174f1118b1641b7a6520144e240ce7.tar.xz zsh-07462f8303174f1118b1641b7a6520144e240ce7.zip |
Frank Terbeck: 25624: clean up git alias parsing.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Completion/Unix/Command/_git | 11 |
2 files changed, 11 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog index 21f556465..67bbcd6c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-09-07 Clint Adams <clint@zsh.org> + + * Frank Terbeck: 25624: Completion/Unix/Command/_git: clean up git + alias parsing. + 2008-09-05 Peter Stephenson <p.w.stephenson@ntlworld.com> * 25627: Doc/Zsh/params.yo, Src/exec.c, Src/params.c, diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index fa8274d44..87c43126b 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -4272,11 +4272,12 @@ local curcontext=$curcontext ret=1 # fun with $words[] and $CURRENT to enable completion for args # to git aliases (eg. git co <TAB>) local -A git_aliases -# TODO: filling git_aliases like this is ugly. I didn't get it working elegantly. -local oifs=$IFS -IFS=$'\0' -git_aliases=(${=${(0)${(@)${${${(f)"$(git config --get-regexp alias.\*)"}/(#s)alias./}/ /$'\0'}}}}) -IFS=$oifs ; unset oifs +local -a git_aliases__ +git_aliases__=(${(f)${${${(f)"$(_call_program alias_expansion git config --get-regexp '\^alias\.')"}#alias.}/ /$'\n'}/(#e)/$'\n'}) +if (( ( ${#git_aliases__} % 2 ) == 0 )) ; then + git_aliases=(${git_aliases__}) +fi +unset git_aliases__ if (( CURRENT >= 3 )) && [[ -n ${git_aliases[$words[2]]} ]] ; then local -a tmpwords expalias |