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 6, 2011, 09:59 UTC
Message-ID
<20110506095920.GA1635@elie>
In-Reply-To
<BANLkTikk1wfaC4Aic4iyJZXbZ5kkuEDxaA@mail.gmail.com>
Felipe Contreras wrote:
> No, the scope remains local.

Is this local in the sense of typeset used in ksh functions declared as "function f" or local in the sense of typeset used in ksh functions declared as "f ()"? If the latter, I think you misunderstood me --- I never meant to suggest otherwise.

> In fact, if you follow the link I posted, that's precisely the fix the
> zsh guys were pushing for. And the it is already merged:
> http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=commitdiff;h=e880604f029088f32fb1ecc39213d720ae526aaa

Now this changes things (since it amounts to a guarantee that the bash completion emulation has already extracted all it needs from $words before calling a completion function). What happens if someone calls "compgen -F" after words is hidden?

> Well, it's hosted on debian.org, and I haven't seen it used anywhere
> else. I just don't know how else to identify that project.
Here you go: http://pkgs.fedoraproject.org/gitweb/?p=bash-completion.git;a=tree

It's called bash-completion or bash_completion. It really has basically nothing to do with Debian; they just are using Debian infrastructure. But hey, call it what you want. I don't like arguing.

> I think the simplest fix is the one I'm proposing

I'm happy with it as long as the zsh people are committed to making sure it continues to work (which it sounds like they are, luckily). I suppose it is intended to obsolete the third patch from Gábor's series? Could you provide an explanation for the commit log, something to the effect that

 - the words array has special meaning
 - that produces such-and-such puzzling symptoms
 - zsh 4.3.12 (?) will fix it by using "typeset -h" to hide it when
   running completion functions designed for bash
 - we can make the same fix to work correctly with earlier versions of
   zsh, and that's what this patch does
?

Sorry I have been so dense --- hopefully I understand it roughly now.

Regards, Jonathan

Previous: Felipe ContrerasNext: Jonathan Nieder
Message 11 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.