summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 36bd844)
raw | patch | inline | side by side (parent: 36bd844)
author | David Symonds <dsymonds@gmail.com> | |
Wed, 29 Oct 2008 16:15:36 +0000 (09:15 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 11 Nov 2008 22:55:43 +0000 (14:55 -0800) |
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-diff.txt | patch | blob | history | |
builtin-diff.c | patch | blob | history |
index c53eba557d0a242a0d8553d9569ce8b2eb86331b..a2f192fb7519117f8e47f3ec4608e3301c200dc3 100644 (file)
commit relative to the named <commit>. Typically you
would want comparison with the latest commit, so if you
do not give <commit>, it defaults to HEAD.
+ --staged is a synonym of --cached.
'git diff' [--options] <commit> [--] [<path>...]::
diff --git a/builtin-diff.c b/builtin-diff.c
index 9c8c295732bf12990b8324bf75968fd68dd41d59..82d4ddabd85072829199fe8dc17c2de15691dac2 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, "--cached") || !strcmp(arg, "--staged"))
cached = 1;
else
usage(builtin_diff_usage);
const char *arg = argv[i];
if (!strcmp(arg, "--"))
break;
- else if (!strcmp(arg, "--cached")) {
+ else if (!strcmp(arg, "--cached") ||
+ !strcmp(arg, "--staged")) {
add_head_to_pending(&rev);
if (!rev.pending.nr)
die("No HEAD commit to compare with (yet)");