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

Re: [QUERY] Why do we have git-completion.zsh?

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Apr 21, 2013, 04:36 UTC
Message-ID
<CALkWK0=ay452TbW-O+uBwqqMjLgeYw0V-j67vvzMqtVO-PnrXw@mail.gmail.com>
In-Reply-To
<CAMP44s3yCW-pHVHc9WfL1BC7BKmnXxZ1WQyPRAMnx967=74_Kg@mail.gmail.com>
Felipe Contreras wrote:
Show 6 quoted lines
> To complement the reason; the zsh folks (or perhaps it's only one; who
> works on the git stuff), absolutely prioritize "correctness" over
> speed, that means if it takes ten seconds to list all the possible
> files to complete, grouped nicely, that's exactly what they'll do,
> instead of the way the bash completion does, which lists the most
> likely files, which takes milliseconds.
I see.  Yes, I was looking for a reason like this.

True. I've noticed that my shell just hangs when I attempt to tab-complete too early/ something wrong, and this would be nice to fix. Does it have to be a hard trade-off between correctness and speed? Is it not possible to reach a fair compromise?

Now, I don't know anything about zsh's git completer versus the gitfast completer. From a glance, it looks like zsh's git completer is much larger and stuffed with features that the gitfast completer doesn't have. Although I agree that speed isn't the only parameter, can you shed some light on how these two compare on other parameters?

Or you could help me figure all this out myself. How do I profile/debug shell code? I'm feeling a little lost without gdb and valgrind.

> And I'm not the only one, when I contributed this stuff to
> oh-my-zsh[1] I got a very positive response.
Found it: https://github.com/robbyrussell/oh-my-zsh/commit/5a11228
Show 5 quoted lines
> If they wanted my contributions, that would be awesome, but that
> doesn't appear to be the case. And I'm kind of relieved, because zsh's
> completion is monstrous code, and the zsh development practices are
> not good (e.g. all my logically independent patches get squashed into
> one commit).

I see. I've just started poking them with patches. I'll see what happens for myself.

Cheers.
Previous: Felipe ContrerasNext: Felipe Contreras
Message 6 of 8 in “[QUERY] Why do we have git-completion.zsh?”
  1. Ramkumar RamachandraApr 20, 2013
  2. Jonathan NiederApr 20, 2013
  3. Jonathan NiederApr 20, 2013
  4. Felipe ContrerasApr 20, 2013
  5. Felipe ContrerasApr 21, 2013
  6. Ramkumar RamachandraApr 21, 2013
  7. Felipe ContrerasApr 21, 2013
  8. Ramkumar RamachandraApr 21, 2013

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.