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

Re: [PATCH for maint] git-completion: fix zsh support

From
Jonathan Nieder <jrnieder@gmail.com>
Date
May 5, 2011, 23:25 UTC
Message-ID
<20110505232503.GA7507@elie>
In-Reply-To
<1304625144-5206-1-git-send-email-felipe.contreras@gmail.com>
Hi,
Felipe Contreras wrote:
Show 7 quoted lines
> It turns out 'words' is a special variable used by zsh completion.
>
> There's probably a bug in zsh's bashcompinit:
> http://article.gmane.org/gmane.comp.shells.zsh.devel/22546
>
> But in the meantime we can workaround it by using 'typedef -h', which
> gets rid of any special meaning.

As I mentioned before (sorry to come in late; I assume you forgot to cc the previous participants in the discussion?), I do not think this is a good fix.

The point here is that 'words' is a special variable used by zsh completion, and we are using facilities from zsh completion. So if you set 'typeset -h', then the zsh completion functions will use _our_ copy of "words".

Now in practice our copy of words matches zsh's anyway, so nothing goes wrong. But that could easily change in the future.

> Currently zsh is completely broken after commit da48616 (bash: get
> --pretty=m<tab> completion to work with bash v4), which introduced
> _get_comp_words_by_ref() that comes from debian's bash_completion
> scripts

The bash_completion project does not originate in Debian fwiw; it was originally from Ian Macdonald iirc and available from

  http://www.caliban.org/bash/index.shtml

and then it was abandoned. The bash-completion project on alioth is not Debian-specific, either.

Maybe simplest would be to use Szeder's fix + make the zsh version of _get_comp_words_by_ref not overwrite "words" at all?

Hope that helps, Jonathan

Previous: Felipe ContrerasNext: Junio C Hamano
Message 6 of 14 in “git-completion: fix zsh support”
  1. git-completion: fix zsh supportFelipe Contreras, May 5, 2011
  2. Junio C HamanoMay 5, 2011
  3. Felipe ContrerasMay 5, 2011
  4. SZEDER GáborMay 5, 2011
  5. git-completion: fix zsh supportFelipe Contreras, May 5, 2011
  6. Jonathan NiederMay 5, 2011
  7. Junio C HamanoMay 6, 2011
  8. Jonathan NiederMay 6, 2011
  9. Felipe ContrerasMay 6, 2011
  10. Felipe ContrerasMay 6, 2011
  11. Jonathan NiederMay 6, 2011
  12. Jonathan NiederMay 6, 2011
  13. Felipe ContrerasMay 9, 2011
  14. Jonathan NiederMay 6, 2011

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.