Revert "git-diff: Introduce --index and deprecate --cached."
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.
Junio C Hamano committed
Dec 13, 2006 at 01:33 UTC
f2dd1c9adfe961ea611545b018bc67e5d83ee3db
2 files changed
+3
-5
Documentation/git-diff.txt
+2
-4
@@ -22,10 +22,8 @@ the number of trees given to the command.
22
23
* When one <tree-ish> is given, the working tree and the named
24
tree are compared, using `git-diff-index`. The option
25
- `--index` can be given to compare the index file and
25
+ `--cached` can be given to compare the index file and
26
the named tree.
27
- `--cached` is a deprecated alias for `--index`. It's use is
28
- discouraged.
27
28
* When two <tree-ish>s are given, these two trees are compared
29
using `git-diff-tree`.
@@ -49,7 +47,7 @@ Various ways to check your working tree::
47
+
48
------------
49
$ git diff <1>
52
-$ git diff --index <2>
50
+$ git diff --cached <2>
51
$ git diff HEAD <3>
52
------------
53
+
builtin-diff.c
+1
-1
@@ -137,7 +137,7 @@ static int builtin_diff_index(struct rev_info *revs,
137
int cached = 0;
138
while (1 < argc) {
139
const char *arg = argv[1];
140
- if (!strcmp(arg, "--index") || !strcmp(arg, "--cached"))
140
+ if (!strcmp(arg, "--cached"))
141
cached = 1;
142
else
143
usage(builtin_diff_usage);