zsh-users
 help / color / mirror / code / Atom feed
* Git completion - trying to improve speed
@ 2010-06-29  9:50 Piotr Kalinowski
  2010-06-29 16:29 ` Benjamin R. Haskell
  0 siblings, 1 reply; 2+ messages in thread
From: Piotr Kalinowski @ 2010-06-29  9:50 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 981 bytes --]

Hi,

I'm working on quite a large repository, and found git checkout completion
to be veeery slow. I've found patch on google that does improve situation
dramatically when you supply some prefix, see:
http://www.zsh.org/mla/workers/2008/msg01535.html. I've applied it to
git-version of git completion. However, I've got weird side effect.

Let user use 'git checkout test-<TAB>', wanting to complete something like
local branch test-feature1 or test-feature2. However:

- First completion is immediately inserted with menu displayed despite the
shell being configured otherwise (inserted in full, not just common prefix).

- The first completion is something like origin/test-feature1 instead of a
local branch.

I'm not much of a shell guru so I thought I'd ask if someone more into the
subject had any ideas what's going on, before I start to reverse-engineer
_git script ;)

Regards,
Piotr Kalinowski

-- 
Intelligence is like a river: the deeper it is, the less noise it makes

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Git completion - trying to improve speed
  2010-06-29  9:50 Git completion - trying to improve speed Piotr Kalinowski
@ 2010-06-29 16:29 ` Benjamin R. Haskell
  0 siblings, 0 replies; 2+ messages in thread
From: Benjamin R. Haskell @ 2010-06-29 16:29 UTC (permalink / raw)
  To: Piotr Kalinowski; +Cc: zsh-users

On Tue, 29 Jun 2010, Piotr Kalinowski wrote:

> Hi,
> 
> I'm working on quite a large repository, and found git checkout 
> completion to be veeery slow. I've found patch on google that does 
> improve situation dramatically when you supply some prefix, see:
> http://www.zsh.org/mla/workers/2008/msg01535.html. I've applied it to 
> git-version of git completion. However, I've got weird side effect.
> 
> Let user use 'git checkout test-<TAB>', wanting to complete something 
> like local branch test-feature1 or test-feature2. However:
> 
> - First completion is immediately inserted with menu displayed despite 
> the shell being configured otherwise (inserted in full, not just 
> common prefix).
> 
> - The first completion is something like origin/test-feature1 instead 
> of a local branch.
> 
> I'm not much of a shell guru so I thought I'd ask if someone more into 
> the subject had any ideas what's going on, before I start to 
> reverse-engineer _git script ;)
> 

Not entirely sure about your problem.

That message is spot-on about the source of the problem, though.  
_multi_parts is really slow.  Since I have a mapping for completing 
filenames generally via ^X^F, I've actually been satisfied with adding 
the following to my startup files:

__git_files(){}

That prevents most(?) filename completion via _git, but I much prefer 
that to the alternative of pegging a CPU at 100% for more than a minute 
whenever I accidentally hit <Tab> after 'git co' (w/ 'co' aliased to 
'checkout') in my work repo (which is much smaller than the kernel repo, 
but many untracked files).

I have a branch in my local zsh repo called completion/_git/why-so-slow, 
but it's been sitting dormant for a while for lack of tuits (along with 
completion/_virtualbox and completion/_imagemagick).

-- 
Best,
Ben


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-29 16:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-29  9:50 Git completion - trying to improve speed Piotr Kalinowski
2010-06-29 16:29 ` Benjamin R. Haskell

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).