3 #=======================================================================
5 # File ID: b51c5d58-5406-11e0-a9ae-552d51fb27db
6 # Compare two different Git histories. Syntax:
7 # git logdiff <commit1> <commit2> [rootcommit]
8 # License: GNU General Public License version 2 or later.
9 #=======================================================================
11 test "$1" = "-p" && { p_str
=-p; shift; }
12 ext
=.git-logdiff.$
(date +%s
).$$.tmp
13 c1
=$
(git log
-1 --format=format
:%h
$1)
14 c2
=$
(git log
-1 --format=format
:%h
$2)
18 mbase
="$(git merge-base $c1 $c2)"
22 git log
--raw --format=raw
$p_str $c1 >/tmp
/$c1$ext
23 git log
--raw --format=raw
$p_str $c2 >/tmp
/$c2$ext
24 vimdiff
/tmp
/{$c1,$c2}$ext