aboutsummaryrefslogtreecommitdiff
path: root/git-diff.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-02-06 11:17:56 -0800
committerJunio C Hamano <junkio@cox.net>2006-02-06 11:22:07 -0800
commitf22fd75c6a39a72d6bf20786ba889fb73038bec9 (patch)
tree3381e92a4619c130706d7777c37803d040df57f0 /git-diff.sh
parenta2c641c4ab66b5bdcb62c36a5f748b9f929d61b8 (diff)
downloadgit-f22fd75c6a39a72d6bf20786ba889fb73038bec9.tar.gz
git-f22fd75c6a39a72d6bf20786ba889fb73038bec9.tar.xz
git-diff: do not fall back on --cc when -[123], --ours etc. are given.
These flags ask diff with a specific unmerged stage, so it should fall back on -p instead. Also when -c is given, we should not do --cc. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-diff.sh')
-rwxr-xr-xgit-diff.sh17
1 files changed, 13 insertions, 4 deletions
diff --git a/git-diff.sh b/git-diff.sh
index b7792a2db..dc4d1b3cf 100755
--- a/git-diff.sh
+++ b/git-diff.sh
@@ -22,14 +22,23 @@ case "$rev" in
esac
esac
-# If we do not have --name-status, --name-only nor -r, default to --cc.
-# If we do not have -B nor -C, default to -M.
+# If we have -[123] --ours --theirs --base, don't do --cc by default.
case " $flags " in
-*" '--name-status' "* | *" '--name-only' "* | *" '-r' "* )
+*" '-"[123]"' "* | *" '--ours' "* | *" '--base' "* | *" '--theirs' "*)
+ cc_or_p=-p ;;
+*)
+ cc_or_p=--cc ;;
+esac
+
+# If we do not have --name-status, --name-only, -r, or -c default to --cc.
+case " $flags " in
+*" '--name-status' "* | *" '--name-only' "* | *" '-r' "* | *" '-c' "* )
;;
*)
- flags="$flags'--cc' " ;;
+ flags="$flags'$cc_or_p' " ;;
esac
+
+# If we do not have -B nor -C, default to -M.
case " $flags " in
*" '-"[BCM]* | *" '--find-copies-harder' "*)
;; # something like -M50.