2005-06-14 00:09:34 +02:00
|
|
|
#!/bin/sh
|
2005-08-23 22:18:00 +02: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"
|
|
|
|
;;
|
|
|
|
?*' ')
|
2005-09-08 02:26:23 +02:00
|
|
|
cmd="git-diff-index $flags $rev $files"
|
2005-08-23 22:18:00 +02:00
|
|
|
;;
|
|
|
|
'')
|
|
|
|
cmd="git-diff-files $flags $files"
|
|
|
|
;;
|
2005-06-14 00:09:34 +02:00
|
|
|
*)
|
2005-08-23 22:18:00 +02:00
|
|
|
die "I don't understand $*"
|
|
|
|
;;
|
2005-06-14 00:09:34 +02:00
|
|
|
esac
|
2005-08-23 22:18:00 +02:00
|
|
|
|
|
|
|
eval "$cmd"
|