You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
701 B
36 lines
701 B
20 years ago
|
#!/bin/sh
|
||
20 years ago
|
#
|
||
|
# 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"
|
||
|
;;
|
||
|
?*' ')
|
||
19 years ago
|
cmd="git-diff-index $flags $rev $files"
|
||
20 years ago
|
;;
|
||
|
'')
|
||
|
cmd="git-diff-files $flags $files"
|
||
|
;;
|
||
20 years ago
|
*)
|
||
20 years ago
|
die "I don't understand $*"
|
||
|
;;
|
||
20 years ago
|
esac
|
||
20 years ago
|
|
||
|
eval "$cmd"
|