summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-02-06 00:36:12 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-02-06 00:36:12 (GMT)
commit4abd89648eb40384556e2118e74be03325d0b05d (patch)
treeab89d5ccdf15b326a3b2017731451eae3f670e2c
parentec0bdb6f1e8fd772ff9eb920ebcb7dd1afcaf362 (diff)
downloadgit-4abd89648eb40384556e2118e74be03325d0b05d.zip
git-4abd89648eb40384556e2118e74be03325d0b05d.tar.gz
git-4abd89648eb40384556e2118e74be03325d0b05d.tar.bz2
diff-index: make --cc a synonym for -p for now.
It could be made later to show unmerged state nicer than the default as we did for diff-files later, but this would suffice for now. We would like to make --cc the default for 'git diff'. Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r--diff-index.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/diff-index.c b/diff-index.c
index bbd873b..f8a102e 100644
--- a/diff-index.c
+++ b/diff-index.c
@@ -201,6 +201,14 @@ int main(int argc, const char **argv)
/* We accept the -r flag just to look like git-diff-tree */
continue;
}
+ if (!strcmp(arg, "--cc"))
+ /*
+ * I _think_ "diff-index --cached HEAD" with an
+ * unmerged index could show something else
+ * later, but pretend --cc is the same as -p for
+ * now. "git diff" uses --cc by default.
+ */
+ argv[i] = arg = "-p";
diff_opt_cnt = diff_opt_parse(&diff_options, argv + i,
argc - i);
if (diff_opt_cnt < 0)