Diff and Patch interface refactored#346
Closed
petrhosek wants to merge 2 commits intolibgit2:masterfrom
Closed
Conversation
Member
|
This is a pretty large commit, if you could split it the review process would be easier and faster. |
|
👍 |
Member
|
If you are still interested, it would be best to rewrite the whole patch/diff stuff with cffi. |
Contributor
Author
|
I have reimplemented both patch and diff with CFFI as suggested. |
|
just 🆒 |
b98e945 to
e28e6f4
Compare
e28e6f4 to
34fd314
Compare
Member
|
Hello Petr, Ok, this is still a huge PR, but I have started to look at it, it will take time though. Thanks! |
Contributor
Author
|
Thanks, please let me know if there is anything you want me to change. |
jdavid
added a commit
that referenced
this pull request
Feb 12, 2015
Comes from PR #346 One difference, DiffLine.origin is a T_CHAR instead of T_OBJECT
|
// , This pull request is stale, no? |
Member
|
Yes, too big of a PR to review. I tried to redo bit by bit and made some commits, but don't have time to finish. Feel free to propose changes (PRs) concerning Diff if you wish, but avoid huge PR. |
Member
|
Closing, sorry it didn't go through at the time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a complete refactoring of the diff and patch interface. The changes include:
DiffandPatchinto separate classes and files, including respective tests. This largely follwos the recent development inlibgit2.DiffDelta,DiffFileandDiffLineclasses and their respective iterators.Blobdiff methods into patch again to be in line with the respectivelibgit2interface.The biggest difference, apart from the code cleanup, is the lazy evaluation due to heavy use of iterators rather than evaluating everything ahead of time as in case of the existing code, which tends to be slow on larger projects.
I have tried to make the interface as "Pythonic" as possible, while closely following the underlying
libgit2C interface. However, some of you might think of a better abstraction and I'd happy to incorporate further changes into the patch.