summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1349f87)
raw | patch | inline | side by side (parent: 1349f87)
author | Junio C Hamano <junkio@cox.net> | |
Wed, 13 Dec 2006 09:33:43 +0000 (01:33 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 13 Dec 2006 10:03:11 +0000 (02:03 -0800) |
This reverts commit 4c81c213a479e4aae0653a56ad6e8db5c31f019c.
Although --cached and --index are confusing wording, the use of
word --cached for git-diff is consistent with git-apply. It means
"work with index without looking at the working tree".
We should probably come up with better wording for --cached, if
somebody wants to deprecate it. But making --index and --cached
synonyms for diff while leaving them mean different things for
apply is no good.
Although --cached and --index are confusing wording, the use of
word --cached for git-diff is consistent with git-apply. It means
"work with index without looking at the working tree".
We should probably come up with better wording for --cached, if
somebody wants to deprecate it. But making --index and --cached
synonyms for diff while leaving them mean different things for
apply is no good.
Documentation/git-diff.txt | patch | blob | history | |
builtin-diff.c | patch | blob | history |
index 3144864d85009824996e3067e78adeadedc63c3d..228c4d95bd41d40bbb32cfcb6b9a7dc648280fa5 100644 (file)
* When one <tree-ish> is given, the working tree and the named
tree are compared, using `git-diff-index`. The option
- `--index` can be given to compare the index file and
+ `--cached` can be given to compare the index file and
the named tree.
- `--cached` is a deprecated alias for `--index`. It's use is
- discouraged.
* When two <tree-ish>s are given, these two trees are compared
using `git-diff-tree`.
+
------------
$ git diff <1>
-$ git diff --index <2>
+$ git diff --cached <2>
$ git diff HEAD <3>
------------
+
diff --git a/builtin-diff.c b/builtin-diff.c
index 1c535b1dd620ce40814da41bdddb8638cafeceb4..a6590205e8f746304f3d06d3e328a05bf2bf954e 100644 (file)
--- a/builtin-diff.c
+++ b/builtin-diff.c
int cached = 0;
while (1 < argc) {
const char *arg = argv[1];
- if (!strcmp(arg, "--index") || !strcmp(arg, "--cached"))
+ if (!strcmp(arg, "--cached"))
cached = 1;
else
usage(builtin_diff_usage);