From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15829 invoked by alias); 26 Apr 2011 20:23:33 -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: 29060 Received: (qmail 20054 invoked from network); 26 Apr 2011 20:23:28 -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.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.161.43 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 :content-transfer-encoding; bh=kv6WO3ZybgqZNVni7RSFdC/4FXV70EdIMFQ3rZpK9hM=; b=ZtTIZbukfBKAqNnk5Md7gxbpUIvjnC214H2yN15L5A0F6OBEYwE72um6ve6cfUQiHq 2d+DN3vHjyQyW+0N8Oef7gwSnXElI9xMf/cNwi+AR8rqHHHrSY+c9QwjzC++kgo9SRWz gzJpT7VVDGYRBdh14hYkZN5k7iAYEwqW9QDUY= 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:content-transfer-encoding; b=T9T82wtG0/pBYDj000SufHBnTbX75uYvpgE6Q3qG8tRk/PrpnPiaJVjfEYZut+Sd2r S8Qz8rOOLa/v5zeNbzsUJtRZgH73J67mLtmRj9ywjzPAUQ8LFDkMo7OXRHdlD9N7WDTx 8fqNjoPI4bUXJ3uBDR8JvNyuW7CT1hWVsOYOc= MIME-Version: 1.0 In-Reply-To: <87liyw7t0o.fsf@ft.bewatermyfriend.org> References: <87liyw7t0o.fsf@ft.bewatermyfriend.org> Date: Tue, 26 Apr 2011 23:23:20 +0300 Message-ID: Subject: Re: Slowness issue with git completion From: Felipe Contreras To: Frank Terbeck Cc: zsh-workers@zsh.org, Nikolai Weibull Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Apr 26, 2011 at 9:43 PM, Frank Terbeck wro= te: > 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. =C2=A0I 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). =C2=A0While they were significantly quicker t= han > 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. 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) Seriously, this is very annoying. --=20 Felipe Contreras