summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ced7b82)
raw | patch | inline | side by side (parent: ced7b82)
author | Andreas Ericsson <ae@op5.se> | |
Thu, 30 Nov 2006 11:43:13 +0000 (12:43 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 2 Dec 2006 05:57:04 +0000 (21:57 -0800) |
'git diff --cached' still works, but its use is discouraged
in the documentation. 'git diff --index' does the same thing
and is consistent with how 'git apply --index' works.
Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
in the documentation. 'git diff --index' does the same thing
and is consistent with how 'git apply --index' works.
Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/git-diff.txt | patch | blob | history | |
builtin-diff.c | patch | blob | history |
index 228c4d95bd41d40bbb32cfcb6b9a7dc648280fa5..3144864d85009824996e3067e78adeadedc63c3d 100644 (file)
* When one <tree-ish> is given, the working tree and the named
tree are compared, using `git-diff-index`. The option
- `--cached` can be given to compare the index file and
+ `--index` 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 --cached <2>
+$ git diff --index <2>
$ git diff HEAD <3>
------------
+
diff --git a/builtin-diff.c b/builtin-diff.c
index a6590205e8f746304f3d06d3e328a05bf2bf954e..1c535b1dd620ce40814da41bdddb8638cafeceb4 100644 (file)
--- a/builtin-diff.c
+++ b/builtin-diff.c
int cached = 0;
while (1 < argc) {
const char *arg = argv[1];
- if (!strcmp(arg, "--cached"))
+ if (!strcmp(arg, "--index") || !strcmp(arg, "--cached"))
cached = 1;
else
usage(builtin_diff_usage);