From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6241 invoked by alias); 10 Dec 2010 12:55:21 -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: 28520 Received: (qmail 28316 invoked from network); 10 Dec 2010 12:55:10 -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, T_TO_NO_BRKTS_FREEMAIL,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at yahoo.co.uk does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1291985289; bh=NAnOIcDAq0UAVVegMoeDeal5MDs/PJjRVCqlUR1R2CU=; h=X-Yahoo-Newman-Id:Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Received:In-reply-to:From:References:To:Subject:Date:Message-ID; b=2JxHFUoJc/yjueunzQcJ+sLGQvIJHkmaQDpk83lHQk+DDZPLiq1y+VLarNm3oxYMLqr3Mj22WadyFSygRsdY5Ug5ZD4ND1x2bm2Gvp4qFMAeW8sC8w8KukRfLJSWg1pPf42y5q0hI3/ADzBhSPlUz5sIZdwwQ5mju91PAhObQoM= X-Yahoo-Newman-Id: 121627.43156.bm@smtp138.mail.ukl.yahoo.com X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- X-YMail-OSG: 8oT7aegVM1kLIfielsKeV4Wj2bWJ633mOxFvm9BQ8c1gks1 7VhAmvheycb1QVXiDPb4zstPXgzrFtdr5oLVIwCcj5t5GQEn8QDjP96a3ePD rY0CxVmXQrLcJF3vzrtElo1bG4gPxDMjRzk6gf9dfWrfsmhiH1JeV6jN3BUb z0IiTXwzxhF9Sd9EI7avTe2vpPeMcTGmHJsJ0wwBQFnytAvUzQBjQ_wZYTLj MqZ.WGEL_JePjErfoB8qofleglqgqxgEzsWVWQT2v2J17RyFv3Qqz3KCt2by ULNpm X-Yahoo-Newman-Property: ymail-3 In-reply-to: From: Oliver Kiddle References: To: zsh-workers@zsh.org Subject: Re: Git completion slowness Date: Fri, 10 Dec 2010 13:48:08 +0100 Message-ID: <631.1291985288@thecus> "Benjamin R. Haskell" wrote: > That prevents all git file completion, which is the cause of the > slowness (specifically, _multi_parts completion for filenames). Recall It's never a great idea when some function tries to do it's own filename completion. While perhaps not blazingly fast, I very much think that the approach I took in _subversion is the best. That approach is to use _files for the actual completion and use the e glob qualifier to filter the files. That way, the many configuration styles and everything for filename completion works as normal. I notice that _git is completing dot files for me without an initial dot for instance. So for _git-add, we'd need something like: __git_filestatus() { [[ $(git status --porcelain $REPLY) = ?M* ]] } __git_modified_files () { _files -g "*(.e:__git_filestatus:)" } That may need to run git status for every file but that's way better than recursing through every subdirectory. Note that it is possible to add non-existant files - look at _subversion for an example. This also loses you the division of files into ignored-modified-files, ignored-other-files etc but you can actually put that back in with a suitable file-patterns style provided __git_filestatus doesn't hard code the regex/pattern (and options needed for e.g. ignored files). I would work on this but if Nikolai has a rewritten _git, I'll hold off. By the way, what's with all the double underscores in _git. Is there some meaning to those or has someone just been doing too much Python. Oliver