From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10423 invoked by alias); 10 Dec 2010 14:00:50 -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: 28521 Received: (qmail 10749 invoked from network); 10 Dec 2010 14:00:38 -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.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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.216.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=VI1+WvvIov/v+2uM5+uloKSpk6tnIJNPKtsrS2FYpis=; b=rigpmJU2r588FdZOkKf2Aswjj/NvusQ3gAdQNNH9sBC7/lwrA60yN869wbopqj3mmG QLrjJXQ8gjqaIhH5zbae5Zjm2d2I2e96ytfF5KHk6NQqP0WKVUsHW6444ILn0vQ0PXCz keSQI7tTzvEQ4/HZalbpEWBn3mJtEtuAlImxs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=QW/JFTuWRlN89/fcFws17xDU3Hj2rD2D/d6gYv4PekAPgcC3GIyyGjPIZ3GBKXjOkt S1tvHeCQZqKCOYGV3VpcpUGS4vbsSj81/1NV1YFioIYGCNwIBCsGJcU/3LI9bTf7LHOd Zkqy8M1AM8S1KH5BjdrOBvJHXuHTqq/eQ3E14= MIME-Version: 1.0 Sender: nikolai.weibull@gmail.com In-Reply-To: <631.1291985288@thecus> References: <631.1291985288@thecus> Date: Fri, 10 Dec 2010 15:00:32 +0100 X-Google-Sender-Auth: IWD5BuFexuL7BHMaY6fa0J79a7Q Message-ID: Subject: Re: Git completion slowness From: Nikolai Weibull To: Oliver Kiddle Cc: zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, Dec 10, 2010 at 13:48, Oliver Kiddle wrote: > "Benjamin R. Haskell" wrote: > So for _git-add, we'd need something like: > __git_filestatus() { > =C2=A0[[ $(git status --porcelain $REPLY) =3D ?M* ]] > } > > __git_modified_files () { > =C2=A0_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. Hm, I thought we had some functions like that already. Perhaps that was in an earlier version. I will look into using this. Let=E2=80=99s hop= e libgit2 finally arrives and someone (OK, I) implement zgit so that we don=E2=80=99t have to do so much forking (think Cygwin). > 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). OK, good. We can have a look at that subdivision later (because I think it=E2=80=99s desirable, especially for _git-add). > I would work on this but if Nikolai has a rewritten _git, I'll hold off. Thanks. I=E2=80=99m sorry that it=E2=80=99s taking so long, but I want to = clean it all up so that future revisions will be easier to make. > 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. Yes, although it=E2=80=99s slightly redundant. _git-* is completion for gi= t *. __git_* is an internal helper function. > Oliver __self__