Prune out some extra merge commits by comparing their parents correctly.