git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-completion: workaround zsh COMPREPLY bug

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jan 25, 2012, 22:02 UTC
Message-ID
<vpqr4ynzbj7.fsf@bauges.imag.fr>
In-Reply-To
<CAMP44s16L0GJUh4JcQgjBXUf4ftT7yQFgPy0p6zCNMnZjZGQww@mail.gmail.com>
Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 11 quoted lines
>>> +             typeset -h IFS
>>
>> No time to test right now, but is this not going to
>>
>> 1) leave IFS as hidden even outside the completion script, possibly
>> affecting unrelated scripts that would need to set IFS as local and keep
>> its special effect?
>
> What special effect?
>
> Unrelated scripts can still set IFS as local.
OK, I missed the fact that typeset -h had only local effect.
Show 9 quoted lines
>> 2) break cases where strings are to be split on \n only (e.g. see
>> "foo bar\nboz" as three possible completions "foo", "bar", "boz" instead
>> of "foo bar" and "boz"?
>
> Those cases are already broken, which is what I reported to the zsh
> mailing list. You would get "foo\ bar" and "boz", and that's after
> 4.3.12; before, compgen -W would still break the completions in 3,
> because they did 'results+=( $words )', instead of 'results+=(
> "$words" )'.
Makes sense.

I still have a minor comment: maybe part of your commit message could go to a comment in the code as well, in particular the "Once zsh is fixed" part, to help future contributors to actually disable the workaround when possible in the future.

Tested-by: Matthieu Moy <Matthieu.Moy@imag.fr>
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Felipe ContrerasNext: Felipe Contreras
Message 4 of 7 in “git-completion: workaround zsh COMPREPLY bug”
  1. git-completion: workaround zsh COMPREPLY bugFelipe Contreras, Jan 25, 2012
  2. Matthieu MoyJan 25, 2012
  3. Felipe ContrerasJan 25, 2012
  4. Matthieu MoyJan 25, 2012
  5. Felipe ContrerasJan 28, 2012
  6. Junio C HamanoJan 26, 2012
  7. Felipe ContrerasJan 27, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.