X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=git-diff.sh;h=dc4d1b3cfd599138f0f25ed778121c273ed256c7;hb=4d569a2c422a9655390e7d33cad0bab88379f13d;hp=4812ae4c1ff937ded49334a97ee1dc2c1732e433;hpb=c2f3bf071ee90b01f2d629921bb04c4f798f02fa;p=git.git diff --git a/git-diff.sh b/git-diff.sh index 4812ae4c..dc4d1b3c 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 -p. -# 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'-p' " ;; + 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.