Filter out irrelevant commit messages.

This is needed if the parentCommit is not on the same branch as the head