+line="$(tail -n 1 $SHA1_FILE)"
+
+# strip everything after the first tab character
+stree=${line%% *}
+if [ "$tree" ]; then
+ [ "$tree" = "$stree" ] || {
+ echo "That is not the last tree merged ($tree v $stree)" 1>&2
+ exit 1
+ }
+else
+ tree="$stree"
+fi
+
+rev=$(git show ${ver}:Next/SHA1s | sed -n "s/^$tree\t\t*//p")
+[ "$rev" ] || {
+ echo "No previous tree/date ($tree/$ver)" 1>&2
+ exit 1
+}
+