My compressed diff format:
OVERVIEW: a simple, human readable format. It is scalable with the ability to add options on the fly.
line 1 = old file name
line 2 = new file name (with changes)
line 3 = old file timestamp
line 4 = new file timestamp
line 5 = diff key
line 6 - infinity = diff
diff key format: <action,start,[(for +)starting line],[range]><action,start,[range]>... [] means its optional
action is +/-. There is NO change action. + is add and - is remove
start is initially 0 and can be changed to any number
starting line is where the changes can be found in the diff file
range is start + range. If range is 0 it is that line only
although the actual changes don't start until line 6, everything before line 6 is disregarded in this sense.
anything not changed in a key is disregarded
NOTE: it is not neccessary to say whether the changes are made in the old or the new file because all changes
are referenced to the old file.
NOTE: the document should be well-formed where the operations happen sequentially, but isn't neccessary.
NOTE: in most regex's that will be used, you can actually use anything as a delimiter for the key attributes. ie
you can use <+a39b20c> if you really wanted to since it will only be searching for a numeric range or > after
<+/-
DIFF KEY EXAMPLES:
To change line 13 and the changes in this file start on line 7: <-,13,0><+,13,0,7> or you can use <-,13><+,13,7>
To change line 13 through 21 (including 13 & 21) and the changes in this file start on line 1: <-,13,8><+,22,1,8>
In the above two examples, the adds directly follow the removal. Technically, they don't have to.
To add 5 lines starting at line 93 and changes in this file start at 48: <+,93,48,5>
ALTERNATIVE METHOD: Instead of using lines to express changes, bytes can be used. I guess an option
somewhere in the diff file before the actual diff keys. Perhaps something like BYTE or LINE before the keys
in the same line or maybe a new line. The only difference would then be that the numbers would become a lot
larger, but you could do inline diff's. All regexes should begin by searching for the first < instead of the
new line to allow for options at the beginning of the diff key line (line 5).