From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28844 invoked from network); 6 Oct 2007 01:10:27 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 6 Oct 2007 01:10:27 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 6163 invoked from network); 6 Oct 2007 01:10:21 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 6 Oct 2007 01:10:21 -0000 Received: (qmail 14241 invoked by alias); 6 Oct 2007 01:10:19 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23909 Received: (qmail 14230 invoked from network); 6 Oct 2007 01:10:18 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 6 Oct 2007 01:10:18 -0000 Received: (qmail 5944 invoked from network); 6 Oct 2007 01:10:18 -0000 Received: from acolyte.scowler.net (216.254.112.45) by a.mx.sunsite.dk with SMTP; 6 Oct 2007 01:10:12 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id 3691D5C2B0; Fri, 5 Oct 2007 21:10:10 -0400 (EDT) Date: Fri, 5 Oct 2007 21:10:11 -0400 From: Clint Adams To: Mikael Magnusson Cc: zsh-workers Subject: Re: Add --cached to git-diff completion Message-ID: <20071006011011.GB21782@scowler.net> Mail-Followup-To: Mikael Magnusson , zsh-workers References: <237967ef0710051613y38c38b18p5deee6092378f952@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <237967ef0710051613y38c38b18p5deee6092378f952@mail.gmail.com> User-Agent: Mutt/1.5.16 (2007-06-11) On Sat, Oct 06, 2007 at 01:13:48AM +0200, Mikael Magnusson wrote: > Not sure how to make _arguments do different things based on options given,for > git-diff ... -- Maybe it'd be worthwhile to make a _git_arguments that understands the special meaning of -- . > it should complete files > and for > git-diff --cached > it should only complete one commit, not two, since we're diffing > against the index One thing you could do is change it to defer all non-option arguments to a state option and add logic to act based on previous words. > but i think the following change is still better than not. (don't add > --cached to $diff_args > since that is also used for git-diff-index and others where the > description is different). Committed.