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

ApplyDiff / RevertDiff #30

Open
kurze opened this issue May 27, 2020 · 5 comments
Open

ApplyDiff / RevertDiff #30

kurze opened this issue May 27, 2020 · 5 comments

Comments

@kurze
Copy link

kurze commented May 27, 2020

Hi there,
awesome lib, thank you, but sadly it only fill half our need.
We are currently implementing patch and reverse patch method for our internal need on known structures, but it seems more logical to be handle by the diff lib.
Do you have support, plan to support or the willingness to accept a PR about apply/patch and revert diff on arbitrary structures ?

@purehyperbole
Copy link
Member

Hey,

I'm not massively familiar with your usecase and how apply/patch and reverse patch works, would you be able to provide an example of how it works?

I'm very much open to accepting new functionality, as long as it doesn't overly complicate the library.

If you're able to give some examples of usage, that would be a massive help.

@kurze
Copy link
Author

kurze commented Jun 2, 2020

Our use case is to keep changes history on a big structures.
To avoid storing a big json at each change, we only want to store the diff on json format. Your lib handle this wonderfully.
But we need to be able to advance or rollback at state for a given time, so take a version of the full struct then apply/revert a changelog.

In our case: The structure is a snapshot of direct and related user data taken at each writing action, that will be used for audit.

We already have a working version for our specific struct and we can probably generalized that.

@purehyperbole
Copy link
Member

Thanks for clarifying. That sounds like a very worthwhile feature and seems like a good fit for the library.

If you need any assistance in the implementation, let me know!

@ghost
Copy link

ghost commented Aug 17, 2020

I to wanted to see Patch / Merge implemented for this however it appears that nobody took the initiative so I did. I forked the main repo and just finished an implementation.

I've also added a PR (#40) should you wish to consider this as an addition to the upstream library.

@kurze
Copy link
Author

kurze commented Aug 19, 2020

Hi, sorry for the latency about this issue, moving priority on the roadmap, I hope I will be able to go back on this subject during September.
Thank you @kyenos, your pull request looks promising.

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

2 participants