2005-06-13 22:09:34 +00:00
|
|
|
#!/bin/sh
|
2005-08-23 20:18:00 +00:00
|
|
|
#
|
|
|
|
# Copyright (c) 2005 Linus Torvalds
|
|
|
|
# Copyright (c) 2005 Junio C Hamano
|
|
|
|
|
|
|
|
rev=$(git-rev-parse --revs-only --no-flags --sq "$@") || exit
|
|
|
|
flags=$(git-rev-parse --no-revs --flags --sq "$@")
|
|
|
|
files=$(git-rev-parse --no-revs --no-flags --sq "$@")
|
|
|
|
|
|
|
|
: ${flags:="'-M' '-p'"}
|
|
|
|
|
|
|
|
case "$rev" in
|
|
|
|
?*' '?*' '?*)
|
|
|
|
die "I don't understand"
|
|
|
|
;;
|
|
|
|
?*' '^?*)
|
|
|
|
begin=$(expr "$rev" : '.*^.\([0-9a-f]*\).*') &&
|
|
|
|
end=$(expr "$rev" : '.\([0-9a-f]*\). .*') || exit
|
|
|
|
cmd="git-diff-tree $flags $begin $end $files"
|
|
|
|
;;
|
|
|
|
?*' '?*)
|
|
|
|
cmd="git-diff-tree $flags $rev $files"
|
|
|
|
;;
|
|
|
|
?*' ')
|
|
|
|
cmd="git-diff-cache $flags $rev $files"
|
|
|
|
;;
|
|
|
|
'')
|
|
|
|
cmd="git-diff-files $flags $files"
|
|
|
|
;;
|
2005-06-13 22:09:34 +00:00
|
|
|
*)
|
2005-08-23 20:18:00 +00:00
|
|
|
die "I don't understand $*"
|
|
|
|
;;
|
2005-06-13 22:09:34 +00:00
|
|
|
esac
|
2005-08-23 20:18:00 +00:00
|
|
|
|
|
|
|
eval "$cmd"
|