commitsBySha needs to be in global scope.
don't revisit explored commits

This is a huge performance enhancement for repos with lots of commits.
Revisiting is totally unnecessary.