Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFE] Add patch method to pygit2.Patch returning patch diff string for an individual changed file #739

Closed
jnareb opened this issue Nov 25, 2017 · 4 comments

Comments

@jnareb
Copy link

jnareb commented Nov 25, 2017

The Diff class / type has patch method, which returns patch diff string, of all changes as whole. You can iterate over Diff and get Patch for each changed file. However Patch class does not have patch method, and there is currently no way to get patch diff string for an individual file.

GitPython has in its equivalent of per-file diff information, namely git.diff.Diff (equivalent of pygit2.Patch) method called diff, which returns patch diff string... but without diff headers.

P.S. Could we have some labels to easily distinguish bug reports from feature requests, and so on, please?

@brandonio21
Copy link
Contributor

I am also interested in this feature. It shouldn't be too difficult at all given the availability of git_patch_to_buf and the Diff.patch blueprint

@jdavid
Copy link
Member

jdavid commented Nov 28, 2017

Thanks!

P.S. I have added a few labels.

@jnareb
Copy link
Author

jnareb commented Nov 28, 2017

Does the #741 also adds Patch.patch to the pygit2 documentation?

@jdavid
Copy link
Member

jdavid commented Nov 28, 2017

No. Added it now in the latest commit. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants