From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24453 invoked by alias); 26 Apr 2011 20:59:25 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29063 Received: (qmail 29288 invoked from network); 26 Apr 2011 20:59:24 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.220.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=W5DITfV6hK42OWfl/mkxUa2YMmaOKq34DoNrxGoiaJU=; b=L9nGNVxS3uL0sX4/H17eaPipbify0k8uZKUghwAsRKcFOvSqOLIH9J/Ni/frp3J13v DriJ922/gFn22iwc/Stg4TUxfBZn9SVI/f0I5uKeCheeeQhijAh2aSMzTDJU/w8rQaye LQp165hdRPKy5VyywzVmyS+CIV9QqWoVlzYho= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=yAL+48/SlMvOK8AyTrE7K3mTG2vTHEPQ7how8dDJcevqjuFq2qtsvxABffGPLlJ4Yw H+HKFnfWFt8WzzA884nwrJCP599HYAFxPvju5ujINVZsu12JjONlm5qV/TcbhCDKIXmt HTw957izPFRMs52CEEKqNDNBi/Qr6GnxSornY= MIME-Version: 1.0 In-Reply-To: References: <87liyw7t0o.fsf@ft.bewatermyfriend.org> Date: Tue, 26 Apr 2011 22:59:20 +0200 Message-ID: Subject: Re: Slowness issue with git completion From: Mikael Magnusson To: Felipe Contreras Cc: Frank Terbeck , zsh-workers@zsh.org, Nikolai Weibull Content-Type: text/plain; charset=UTF-8 On 26 April 2011 22:57, Felipe Contreras wrote: > On Tue, Apr 26, 2011 at 11:34 PM, Mikael Magnusson wrote: >> On 26 April 2011 22:23, Felipe Contreras wrote: >>> On Tue, Apr 26, 2011 at 9:43 PM, Frank Terbeck wrote: >>>> Felipe Contreras wrote: >>>>> It's very easy to reproduce: >>>>> % git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git >>>>> linux >>>>> % cd linux >>>>> % git log v >>>>> >>>>> It will take a looong time to figure out anything, specially if not >>>>> cached. I think I recall investigating the issue and finding that it's >>>>> looking for *all* the files in the git repo. >>>> >>>> Well yes. This is a known issue. >>>> >>>> I'm fairly sure that this is due to _multi_parts, which probably doesn't >>>> scale for jobs like that. I once gave rewriting all that a shot and >>>> ended up with a number of helpers for each "type" of file etc. (like >>>> modified or ignored files). While they were significantly quicker than >>>> the current code, they were probably still full of bugs and >>>> shortcomings. Also, I would have had to rewrite *large* parts of the >>>> rest of the completion, which would have been a *major* undertaking. >>>> >>>> In short: It's a known issue and it's very hard to fix (if only because >>>> it is a *lot* of work). >>> >>> Here's a quick solution: don't try to list files. If I want to list >>> files, I would use '-- '. And in fact, that's exactly what the bash >>> completion does. >> >> git accepts files with or without a -- > > So? So if the command works, we should complete it. >>> Moreover, why do you want to be smarter than git? There are ways to >>> ask git precisely what we want: list the contents of certain tree-ish >>> on-demand. And in fact, that's exactly what the bash completion does: >>> >>> time git ls-tree HEAD -- (0m0.005s) >>> time git ls-tree HEAD -- drivers/ (0m0.007s) >> >> git ls-tree doesn't allow you to filter the output files by 'changed', >> 'new', 'unknown' etc etc. > > So? So we can use ls-tree for log i guess, but not for much else, git add will still be slow for example. -- Mikael Magnusson