You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
I am looking to use bsdiff to keep a record of the changes I make to a file. As I see it, I keep the original file and then I can keep patching all the diffs to that file to get to the current state of that file. However I have been wondering if I can go the other way around and if I have the current state of the file, can I "strip" off patches and get back to the original state of the file? I don't know if that reads sensically at all!
If I have a file, let's call them v0.x for example,
V0.1
V0.2
V0.3
Then bsdiff will give me the diffs between each version. If I then have v0.1 I can patch it twice to get to v0.3.
However if I have v0.3 is there a way I can patch it to get back to v0.2 and therefrom 0.1?
I have the diff between v0.2 and v0.3 but I guess that's not the same as having the diff of v0.3 and v0.2 is it?
I had wondered if there was a nifty XOR of the diff or something that could be done to go backwards??
I would appreciate any help you can give. Thanks
Alex
The text was updated successfully, but these errors were encountered:
Hello, an undo functionality is just creating patches that go in reverse. So when you create your diff, instead of using old, new, use new, old. This will give a diff that goes in reverse.
If however, you only have the patch files and you want to go backwards because you lost the old file, I don't know about that, which makes this comment not helpful. Good luck!
Edit: Assuming that bsdiff works anything like zdelta did, then no, because the patch file uses blocks of the old to reconstruct the new. If bsdiff does not use parts of the old file, then its still improbable that the old information is there. Since I'd suspect the patch file keeps pointers and run length + blocks to be written, but doesn't keep track of what was there previously (It would be size expensive to keep this redundent information).
So, after further thinking, I'd have to say its very likely not possible to create a reverse patch without the original file.
Hi
I am looking to use bsdiff to keep a record of the changes I make to a file. As I see it, I keep the original file and then I can keep patching all the diffs to that file to get to the current state of that file. However I have been wondering if I can go the other way around and if I have the current state of the file, can I "strip" off patches and get back to the original state of the file? I don't know if that reads sensically at all!
If I have a file, let's call them v0.x for example,
V0.1
V0.2
V0.3
Then bsdiff will give me the diffs between each version. If I then have v0.1 I can patch it twice to get to v0.3.
However if I have v0.3 is there a way I can patch it to get back to v0.2 and therefrom 0.1?
I have the diff between v0.2 and v0.3 but I guess that's not the same as having the diff of v0.3 and v0.2 is it?
I had wondered if there was a nifty XOR of the diff or something that could be done to go backwards??
I would appreciate any help you can give. Thanks
Alex
The text was updated successfully, but these errors were encountered: