GitPython を使用して次のコードを試すと、次のようになります。
repo.head.commit.diff('HEAD~1')[0].diff
常に空の文字列を返します。さまざまなコミットでも何度もファイルを変更しました。
最初のコミットと最後のコミットの間に変更されたすべてのファイルをリストする次のコードも試しました。
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