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

Forward and backward patches (enhancement) #62

Open
GoogleCodeExporter opened this issue Mar 24, 2015 · 12 comments
Open

Forward and backward patches (enhancement) #62

GoogleCodeExporter opened this issue Mar 24, 2015 · 12 comments

Comments

@GoogleCodeExporter
Copy link

What is the posibility of creating the vcdiff files for two files for both 
directions at the same time, e.g. a forward patch and reverse patch at the 
same time, I guess it must be posible it is just how complicated is it to 
do. It would be the same as doing 

xdelta3.exe file1.exe -s file2.exe output1.vcdiff

and 

xelta3.exe file2.exe -s file1.exe output2.vcdiff

doing this in a single step would improve the performance in my case as I 
want to keep 2 copies of each of the source files one locally with reverse 
patches and one updated on a server located on the internet updated with 
the forward patch.

thanks



Original issue reported on code.google.com by a...@intralan.co.uk on 8 Jan 2008 at 5:57

@GoogleCodeExporter
Copy link
Author

I am more interested in a utility to reverse a patch, given its source file.  
Then
you could run something like:

xdelta3.exe -s file1 file2 out2.vcdiff
xdelta3.exe reverse -s file1 out2.vcdiff out1.vcdiff

But first, I need to finish the "merge" command, which I'm working on.

Original comment by josh.mac...@gmail.com on 10 Jan 2008 at 2:51

  • Changed state: Accepted
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

so let me understand this better, with your idea of reverse a single patch 
could 
roll a file forward or backward?, if this is the case and the merge command did 
what 
I expect there could be a single command to take a file forward or backward and 
many 
versions. Rather than having to process the file forward and then backward to 
create 
both patches and having to roll x patches forward or backward to make a 
specific 
revision of the file. Am I right?



Original comment by a...@intralan.co.uk on 10 Jan 2008 at 8:05

@GoogleCodeExporter
Copy link
Author

Yes, correct.

Original comment by josh.mac...@gmail.com on 10 Jan 2008 at 8:37

@GoogleCodeExporter
Copy link
Author

Hi Josh, the idea of being able to reverse a patch interests me too. Have you 
any 
idea when you might have this available? Is the diff structure such that 
everything 
can be reliably reversed (e.g. Insert n bytes at offset m -> remove n bytes at 
offset m) etc... or will additional info be required inside the diff file - if 
the 
file has got smaller, I assume you don't store the data that was removed in the 
diff 
file so addional info would be required in to go backwards?? I guess what I'm 
driving at is do you think it might work with existing diff files produced with 
an 
older version of xdelta? I suspect not.

Original comment by m...@cucku.com on 8 May 2008 at 12:55

@GoogleCodeExporter
Copy link
Author

A reverse patching mechanism would be very helpful indeed.  I have an 
application by 
which I want to take a patch file and be able to use it to:  given A create B, 
or if 
given B, create A.

An excellent program btw, thanks for the time and effort you've put into this.

Original comment by joeainte...@gmail.com on 9 Jun 2008 at 9:13

@GoogleCodeExporter
Copy link
Author

There seem to be several approaches:

1. Modify the software and file format to support bi-directional patches
2. Modify the software to support a "reverse" operation

#2 is easier.  You would compute the forward differences and then compute the
reverse.  It's not a single step and it's a little less efficient, but it's 
much more
flexible.

Computing the reverse would require the target file to be present.  I.e.,

xdelta3 -s SOURCE TARGET FORWARD.vcdiff
xdelta3 reverse -s TARGET FORWARD.vcdiff REVERSE.vcdiff

The code to compute the reverse operation would be useful for computing 
reversals in
a chain of deltas.  For example, if you have v1->v2, v2->v3 stored, and you 
would
like to prepare a v3->v1 difference file...

Original comment by josh.mac...@gmail.com on 11 Jun 2008 at 4:54

@GoogleCodeExporter
Copy link
Author

Is there any progression?
I'm interesting in reversing xdelta patch.

Original comment by Rimidal...@gmail.com on 11 Jun 2010 at 7:10

@pallinger
Copy link

This would be a very nice feature!

@JockeTF
Copy link

JockeTF commented Feb 25, 2016

I'd be very interested in something like this as well!

@sl1pkn07
Copy link

same here

is not possible revert the xdelta like patch can do with patch -R?

@StevenDoesStuffs
Copy link

Any updates; will this become a feature?

@Gragog
Copy link

Gragog commented May 22, 2020

I would be interested as well

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

No branches or pull requests

6 participants