Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Add --cached to git-diff completion



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 ... -- <tab>

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 <tab>
> 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.



Messages sorted by: Reverse Date, Date, Thread, Author