xdelta
xdelta copied to clipboard
Feature request: partial deltas
I'd like to have a way to partially transform the old file into the new file.
Given an xdelta file containing multiple independent changes (inserts, deletes,
replacements) produce a numbered list of those changes. Then, when given that
list or a subset of it, apply only those changes. So, given a list file
containing "1 2 3 4 5", a subset file could be generated containing "1 3 5",
and the resulting xdelta-patched output file would have only change 1, 3 and 5
applied.
The reason I want to do this is because I've been playing with the 'delta'
program (http://delta.tigris.org/), which finds the smallest subset of an input
file that causes a program to fail. Initially used to find bugs in gcc,
there's nothing preventing it from being used with any program or input file,
except that it works with line-based text files, or source code that it
recognizes.
With this new feature, delta could find minimal changes of *binary* files that
trigger bugs; given a good binary and bad binary, xdelta would produce various
hybrid binaries that could then be tested. Right now, I'm doing the same thing
with xxd, diff and patch, plus some gawk code which I'm really not proud of.
Thanks!
PS: Plus, it would be cool to have two programs named delta and xdelta working
together on the same problem, but don't let that sway your opinion...
Original issue reported on code.google.com by [email protected] on 24 Mar 2011 at 6:25
This is a nice idea.
The Inserts, Deletes, and Replacements you mentioned are not computed
internally or expressed, because that is a fundamentally different problem.
But, it would be interesting to work on.
Original comment by [email protected] on 18 Jun 2012 at 3:26
But VCDIFF has three instructions, add, copy and run: by numbering the
instructions in any given delta and listing them to a file, this would generate
the required list file. When reconstructing the new file from the old file and
the delta, you could read in a modified list file to determine which
instructions to obey:
Obey all instructinos = get new file.
Obey no instructions = get old file.
Obey some instructions = get hybrid file.
Just a thought...
Original comment by [email protected] on 19 Jun 2012 at 6:29