-
Notifications
You must be signed in to change notification settings - Fork 899
Split Patch and TreeChanges #512
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
Conversation
IMO, this seem like a lot of additional complexity to avoid what is essentially a two- or three-option flag (None | CountLines | GeneratePatch). Supporting a |
@dahlbyk I'd rather not expose properties which would be |
Happy to see that this is being addressed and changed 👍 Having said that, that is a lot of changes. I hope that they don't change too much on apis and that they test-suite is good, hence verifying that all previous test-cases still pass as well as having added new cases to verify the new ways to use them. Following @dahlbyks suggestion and taking into @nulltokens comment about null properties: What if the diff-object was an abstract with different inheriting types? Then, dependent on what type of diff one wanted, the diff object was instantiated accordingly and would then have only the relevant properties? But, for all I know this works the way it is made now. Until I get the chance to test and use this in real world I cannot really argue for or against. |
Throw @Spiralis I do think there could be a common base class to share between |
@dahlbyk I hear what you say about the code complexity. And I agree from the perspective of a contributor to the library. From a user perspective, making properties return |
I had the same feeling, but so I will take a look at it. I also have an idea that I think would make the API easier to discover, while fitting with some of @dahlbyk expectations. I will have a go at it sometime today, stay tuned! |
New version:
This leads to a breaking changes in the API (removed properties from |
I haven't had a chance to look closely at this - but another behavior that might be desirable in the future is the ability to optionally perform rename detection as part of the |
Comments and tests up to date! |
The
Ready for review. |
👍 for me me Anyone? |
Remove Patch from TreeChanges Make repo.Diff.Compare() generic
❤️ 👍 🎱 ✨ |
This looks like a really good solution. Thanks. 👍 😃. I'll update my app to use the latest version instead of my own fork. I closed #483 as a result of this change. |
Linked to #483.
The idea is to remove the generation of the patch from the
TreeChanges
class, and in the process to createrepo.Diff.GeneratePatch()
(naming advices welcome!) methods to fullfill the need of patch generation.I'm not very happy with the current complexity of the diff code, and am still trying to find a better way to do it, but I thought it would be interesting to have some early feedback.