When I try the following code using GitPython:
repo.head.commit.diff('HEAD~1')[0].diff
It always returns an empty string. I've changed the file many times I tried in different commits as well.
I've also tried the following code that would list all the changed files between the first and the last commits.
changed_files = []
for x in commits_list[0].diff(commits_list[-1]):
if x.a_blob.path not in changed_files:
changed_files.append(x.a_blob.path)
if x.b_blob is not None and x.b_blob.path not in changed_files:
changed_files.append(x.b_blob.path)
print changed_files