Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
git-diff: do not fall back on --cc when -[123], --ours etc. are given.
author
Junio C Hamano
<junkio@cox.net>
Mon, 6 Feb 2006 19:17:56 +0000
(11:17 -0800)
committer
Junio C Hamano
<junkio@cox.net>
Mon, 6 Feb 2006 19:22:07 +0000
(11:22 -0800)
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>
git-diff.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
a2c641c
)
diff --git
a/git-diff.sh
b/git-diff.sh
index b7792a2db3dac54adfd14835108bc36921bf04dc..dc4d1b3cfd599138f0f25ed778121c273ed256c7 100755
(executable)
--- a/
git-diff.sh
+++ b/
git-diff.sh
@@
-22,14
+22,23
@@
case "$rev" in
esac
esac
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
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
esac
+
+# If we do not have -B nor -C, default to -M.
case " $flags " in
*" '-"[BCM]* | *" '--find-copies-harder' "*)
;; # something like -M50.
case " $flags " in
*" '-"[BCM]* | *" '--find-copies-harder' "*)
;; # something like -M50.