summaryrefslogtreecommitdiff
path: root/git-diff-script
blob: 673853b9ce3a5200c0085f33d1e41f12cf18eb0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
rev=($(git-rev-parse --revs-only "$@"))
flags=($(git-rev-parse --no-revs "$@"))
case "${#rev[*]}" in
0)
	git-diff-files -M -p "$@";;
1)
	git-diff-cache -M -p "$@";;
2)
	begin=$(echo "${rev[1]}" | tr -d '^')
	end="${rev[0]}"
	git-diff-tree -M -p $flags $begin $end;;
*)
	echo "I don't understand"
	exit 1;;
esac