6fcf790738f10bdc7672efe46b7142adfec1aab4
[rrq/reviewtool.git] / git-differ
1 #!/bin/bash
2 #
3 # Assumes a lot about invocation:
4 # commit1 commit2 -- path
5
6 EXT="${4##*.}"
7
8 case "$EXT" in
9     png|jpg|bmp)
10         F1=$(mktemp --suffix=$EXT)
11         git cat-file -p $1:$4 > $F1
12         F2=$(mktemp --suffix=$EXT)
13         git cat-file -p $2:$4 > $F2
14         montage $F1 $F2 -tile 2x1 -geometry +5+5 -border 2  png:- | display -
15         rm -f $F1 $F2
16         ;;
17     *)
18         git meld $*
19         ;;
20 esac