Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

bug in _git: (was Re: _git:6147: math recursion limit exceeded )



It turned out, that
_git_third_party_commands+=$name$desc
should be
_git_third_party_commands+=($name $desc)


On Mon, Feb 25, 2013 at 10:31 AM, Michal Maruska <mmaruska@xxxxxxxxx> wrote:
> Hello,
> I have problem with  completion for: git  <TAB>.
>
> I have some  "third party" git commands with provided zsh completion.
>
> They are named _git-segment  _git-segment-name  etc.
>
> I see this relevant code in _git:
>
> line 6139:
> declare -gUa _git_third_party_commands
>
> I would have expected  -A associative array.
>
> then:
>
> local name=${${file:t}#_git-}
> if (( $+_git_third_party_commands[$name] )); then
> ....
>
> so my question is why  -- $name being   "segment-name" --,
> this  [$name] leads to recursion? How to avoid (& why is that needed)
> xxxx-name being interpreted as arithmetic (which obviously does lead
> to recursion on $name)?
>
>
> Thank you



Messages sorted by: Reverse Date, Date, Thread, Author