From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3906 invoked from network); 24 Jan 2008 06:46:38 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 24 Jan 2008 06:46:38 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 26020 invoked from network); 24 Jan 2008 06:46:33 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 24 Jan 2008 06:46:33 -0000 Received: (qmail 18268 invoked by alias); 24 Jan 2008 06:46:29 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24456 Received: (qmail 18253 invoked from network); 24 Jan 2008 06:46:28 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 24 Jan 2008 06:46:28 -0000 Received: from virusfilter.dotsrc.org (bifrost [127.0.0.1]) by spamfilter.dotsrc.org (Postfix) with ESMTP id B2C6C8058F58 for ; Thu, 24 Jan 2008 07:46:15 +0100 (CET) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.178]) by bifrost.dotsrc.org (Postfix) with ESMTP for ; Thu, 24 Jan 2008 07:46:14 +0100 (CET) Received: by wa-out-1112.google.com with SMTP id j4so241923wah.21 for ; Wed, 23 Jan 2008 22:46:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=B0SdMIXYGAHMLRETHEqWzyjOCDRRVDLC4leOx866FcE=; b=kCvIYZVa6jhzAKIWu+XfaFnZEO1YDcVbfotTLGYMmZWh3cH3Jzed77o4vyOD1p3THbi2eL0tWV+47ECq2xFyAl6gQg1NZzaqoTYetg6W6zU/vghA6UBrU9xgK1KjyCvtyW1pF3LBGlsc/343jpLEf7Xp/U7l6ldoNhgq/24i3V4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=svkFNTNZ05nxE2DdrrMrzNc4PfV+NCNZAvrxHHuccDGwp5hQc3VB7JijpsuKP94X8NAHQ3zhWaZqc6g2z/Cu2/ttpJvahJCzRnxYn8jXGVOuQGRDkLJ5ofLMRxBDimJQPDGZxoPk/4LRk8DfYUBug/SmoRn6WXI3Txlk2OnlPGw= Received: by 10.141.185.3 with SMTP id m3mr217229rvp.236.1201157173013; Wed, 23 Jan 2008 22:46:13 -0800 (PST) Received: by 10.140.127.7 with HTTP; Wed, 23 Jan 2008 22:46:12 -0800 (PST) Message-ID: <237967ef0801232246n1f6c02ffv4083ce2323b36e0e@mail.gmail.com> Date: Thu, 24 Jan 2008 07:46:12 +0100 From: "Mikael Magnusson" To: zsh-workers@sunsite.dk Subject: Re: git completion horribly slow in kernel tree In-Reply-To: <20080123164835.GA32341@scowler.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <237967ef0801141339p73414915xc411253211ed7467@mail.gmail.com> <20080122011932.GB16813@scowler.net> <237967ef0801211740s1ee07850vc25984a7af262cac@mail.gmail.com> <20080122162222.GA503@scowler.net> <20080122171249.GA2361@scowler.net> <237967ef0801230320n7fbd3582xf8a149e10f83e708@mail.gmail.com> <20080123132925.GA26303@scowler.net> <237967ef0801230830t55434367p31c78b56df461454@mail.gmail.com> <20080123164835.GA32341@scowler.net> X-Virus-Scanned: ClamAV using ClamSMTP On 23/01/2008, Clint Adams wrote: > On Wed, Jan 23, 2008 at 05:30:05PM +0100, Mikael Magnusson wrote: > > Hm, I don't really know... git ls-tree seems to not want to output .., > > if you specify --full-name, it does show the dir you specify, but > > relative to the root of the project. So if you're in proj/dir1/dir2 > > and git ls-tree --full-name --name-only HEAD .., you will get files > > shown as dir1/file1. I guess it's possible to use that output, but > > maybe it's easier to just manually cd to the proj/ dir first :). I > > just looked at the bash completer (which is very confusing code), and > > it seems to use something like > > git --git-dir=$(git rev-parse --git-dir) ls-tree $ref:prefix > > which lists the file as file1 instead of dir1/file1. (no idea why it > > doesn't use --name-only). > > I just looked and git-add completion is using ls-files, which can't > handle relative paths either. Hm, this "works", but it definitely isn't nice, and doesn't work when you type the shorter path manually first. # Untracked files: # Src/Modules/curses_keys.h if i'm sitting in Src/Builtins, the following code will produce git add git add ../ git add ../../ git add ../../Src/Modules git add ../../Src/Modules/curses_keys.h which is not so great. Annoyingly, when i'm sitting in Src/Builtins, git status produces the following # Untracked files: # ../Modules/curses_keys.h I don't know how often one really wants to git add files above the current dir, but it just annoys me that it's so hard to fix. :) (( $+functions[__git_files] )) || __git_files () { local expl files ls_opts opts gitdir cdup zparseopts -D -E -a opts -- -cached -deleted -modified -others -ignored -unmerged -killed gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null) __git_command_successful || return ls_opts=("--exclude-per-directory=.gitignore") [[ -f "$gitdir/info/exclude" ]] && ls_opts+="--exclude-from=$gitdir/info/exclude" cdup=$(_call_program revparse git rev-parse --show-cdup) files=(${(ps:\0:)"$(_call_program files git ls-files --full-name -z $ls_opts $opts $cdup 2>/dev/null)"}) files=$cdup${^files} __git_command_successful || return _wanted files expl 'index file' _multi_parts $@ - / files } -- Mikael Magnusson