#!/bin/bash

#hash="93e83d5cd6009a9ec99471face8c5bd87bf752ee"
starthash="${1:-"HEAD"}"
pause="$2"

echo $starthash

gettime () {
	git log $1 -n1 --pretty=format:%${2:-"at"}
}

git log --reverse ${starthash}...master --oneline | while read commit rest; do 
	committime=$(gettime $commit)
	diff=$(($committime - $(gettime $commit~1) ))
	waitfor=${pause:-$diff}
	echo -e "\nwaiting $waitfor seconds…"
	sleep $waitfor
	git checkout $commit
	touch -d "$(gettime $commit ai)" * 
done




