Use the --parents flag to git-rev-list.