From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1154 invoked from network); 5 Oct 2007 23:14:04 -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; 5 Oct 2007 23:14:04 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 52051 invoked from network); 5 Oct 2007 23:13:58 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 5 Oct 2007 23:13:58 -0000 Received: (qmail 9336 invoked by alias); 5 Oct 2007 23:13:55 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23907 Received: (qmail 9322 invoked from network); 5 Oct 2007 23:13:55 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 5 Oct 2007 23:13:55 -0000 Received: (qmail 51794 invoked from network); 5 Oct 2007 23:13:55 -0000 Received: from nz-out-0506.google.com (64.233.162.231) by a.mx.sunsite.dk with SMTP; 5 Oct 2007 23:13:50 -0000 Received: by nz-out-0506.google.com with SMTP id r28so526641nza for ; Fri, 05 Oct 2007 16:13:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=D4V+WI5HYBczJTf+LD93g9cIlbDLJRW1b6a/rNHhan8=; b=rvT3SYaHd7p1q26p4+9oKx2McAkDyy8T15/t1Pgb03+jK5xleQ+iAai6YB45lNGJecezEkBJkGML5kh1Y+fg8LWh8L4PVgGgcLSHqVP/YaBJej++XtG3ZDFtQv8H+UkDpYm2CSAp+/Q1G4aAQkdfnMojXjP2GsPkdw3ASsn0ZuE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=Q/iO3KF2XgJLojQ28ylAzhVIdObGhbhkPH+nXxJjhbDL/e1zVTAHYUo83z+wMTcUg7dw17IuIWlFm4OikzLg9h0c9aY0WCAqEv+jrqUSgdijefOpkcnEnyv6pNZh3Ersj3cMB2VEo6C8pZazd5uD/jI0RHwkxLTZk/MjNkuy4H0= Received: by 10.142.97.20 with SMTP id u20mr1672329wfb.1191626028532; Fri, 05 Oct 2007 16:13:48 -0700 (PDT) Received: by 10.142.86.21 with HTTP; Fri, 5 Oct 2007 16:13:48 -0700 (PDT) Message-ID: <237967ef0710051613y38c38b18p5deee6092378f952@mail.gmail.com> Date: Sat, 6 Oct 2007 01:13:48 +0200 From: "Mikael Magnusson" To: zsh-workers Subject: Add --cached to git-diff completion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Not sure how to make _arguments do different things based on options given,for git-diff ... -- it should complete files and for git-diff --cached it should only complete one commit, not two, since we're diffing against the index 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). diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 3a365e5..9dcb481 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -1585,6 +1585,7 @@ __git_zstyle_default ':completion::complete:git-commit:argument-rest:*' ignore-l _git-diff () { _arguments -S \ $diff_args \ + '--cached[show diff between index and named commit]' \ '::original revision:__git_commits' \ '::new revision:__git_commits' \ '*::index file:__git_modified_files' && ret=0 -- Mikael Magnusson