Small performance improvement.

Can now check whether a commit is in ANY of the LHS commits in a single Git command.

Also, flush output after each commit.
Performance improvements!

Instead of doing a `git merge-base` for every RHS commit, now we just
'git log' all commits that would be unique to that RHS and only print
those.

This also seems to fix a bug in the previous commit that resulted in
showing some duplicate history.