I'm trying to find the content of the commits that have been checked in between two specific commits.
In git I'd do
git rev-list --ancestry-path <older_commit_sha>..<newer_commit_sha>
repo.git.execute()
Commit
execute()
After much poking, and given this question is not getting much traction, I resorted to using .execute()
.
Specifically:
commits = repo.git.execute(['git', 'rev-list', '--ancestry-path',
'%s..%s' % (oldCommit.hexsha, newCommit.hexsha)]).split()
Of course, oldCommit
and newCommit
are git.Commit
objects.