From: "Mikael Magnusson" <mikachu@gmail.com>
To: zsh-workers <zsh-workers@sunsite.dk>
Subject: Add --cached to git-diff completion
Date: Sat, 6 Oct 2007 01:13:48 +0200 [thread overview]
Message-ID: <237967ef0710051613y38c38b18p5deee6092378f952@mail.gmail.com> (raw)
Not sure how to make _arguments do different things based on options given,for
git-diff ... -- <tab>
it should complete files
and for
git-diff --cached <tab>
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
next reply other threads:[~2007-10-05 23:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-05 23:13 Mikael Magnusson [this message]
2007-10-06 1:10 ` Clint Adams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=237967ef0710051613y38c38b18p5deee6092378f952@mail.gmail.com \
--to=mikachu@gmail.com \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).