GitPython icon indicating copy to clipboard operation
GitPython copied to clipboard

Get patch text from Commit class like (commit.stats)

Open dduraipandian opened this issue 3 years ago • 1 comments

Current we can get status for the commit (comparing parent). But can't get patch text.

I would like to have commit.patch to get patch text. Result will be similar to git diff shell command.

git diff <c1> <c2>
all_commits = repo.iter_commits('master')
for commit in all_commits:
    print(commit.stats)

If the community is okay with this addition, i can work on this and raise a PR.

Thanks in advance, Durai Pandian

dduraipandian avatar Feb 25 '22 13:02 dduraipandian

That sounds like something useful worth having. Please feel free to sketch an implementation in a draft PR for early feedback.

Byron avatar Feb 25 '22 13:02 Byron