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

Re: Completion for branches or tags broken with zsh

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Apr 2, 2011, 22:50 UTC
Message-ID
<20110402225045.GA22781@elie>
In-Reply-To
<1jxqbmc.vc0luayavmrkM%lists@haller-berlin.de>
Hi Stefan,
Stefan Haller wrote:
> In the current master (and 1.7.4), tab completion for refs doesn't work
> in zsh.  When typing "git log orig<TAB>", nothing appears.

Sorry for the long silence. Indeed, it seems that I broke this in da48616f1d (bash: get --pretty=m<tab> completion to work with bash v4, 2010-12-02). No fix yet.

Here's the puzzle: _git calls _get_comp_words_by_ref to fill the local array "${words[@]}". It doesn't succeed. Within _get_comp_words_by_ref, ${words[@]} gets filled correctly, but within _git, it keeps the value it previously had.

Alas, that's as far as I can get without learning something about zsh. :) I can't reproduce it when defining functions like this directly, so there might be something subtle going on.

Hints?

Thanks for noticing. Jonathan

Previous: Stefan Haller
Message 2 of 2 in “Completion for branches or tags broken with zsh”
  1. Stefan HallerMar 6, 2011
  2. Jonathan NiederApr 2, 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.