#!/usr/bin/bash function dshow { git show $1 | eat-diff-numbers } function comp { ap="/tmp/[a $3] $(git log --format=%f -n 1 $1).patch" bp="/tmp/[b $3] $(git log --format=%f -n 1 $2).patch" dshow $1 > "$ap" dshow $2 > "$bp" if ! diff "$ap" "$bp" > /dev/null ; then co=$(git log --format=%s -n 1 $2) echo -n $co - differs | tee -a loglog echo "$ap - $1" echo "$bp - $2" echo "type exit to continue" #git diff --no-index --color-words --word-diff-regex=. /tmp/{a,b}.patch if vimdiff < /dev/tty -c 0 "$ap" "$bp" ; then echo " - ok" | tee -a loglog else echo " - bad" | tee -a loglog fi return 1 fi } a=$1 b=$2 n=$3 for ((i=1; i<=n; i++)); do rr=$((n - i)) co=$(git log --format=%s -n 1 $b~$rr) if comp $a~$rr $b~$rr $i; then echo $co - ok | tee -a loglog fi done