Factor out commit list from compare and new MR.
Merge pull request #7657 from cirosantilli/factor-commit-list

[refactor] Factor out commit list from compare and new MR.