janjongboom/janpatch

JojoDiff 8.0.4 (Sept 2020) changed diff format

Mgamerz opened this issue · 3 comments

Don't know if this project is still maintained, but as of September 2020 there is an update to jdiff that produces slightly different patch files.
https://sourceforge.net/projects/jojodiff/files/

Existing diff-files will be handled correctly by the new version, 
but diff-files from the new version will not be handled correctly by previous versions !

I write my own implementation of JPatch for C# (however, my project is GPL, so I have no problems with the license) - I am still looking into seeing what's changed, but I think it should be noted that unless the patch code is updated, implementations of jpatch/janpatch may not work with the latest version of jdiff.

After reviewing the code, I didn't see any changes. I emailed Joris and he gave me this data on the updated implementation:

Hi,
The only change is that the ESC-MOD sequence is now the default when a new operation sequence is needed (at the start of a file or after an EQL, DEL or BKT operation). 
It's a small efficiency gain of 2 bytes, but also simplifies the code.
Thank's for using jdiff !
Best regards,
Joris Heirbaut

After reading this, the new code makes sense, at the beginning of the file read and the end of the operations the current opcode is set back to ESC. A simple change but it would indeed break parsing. This is just an FYI in case anyone wants to implement this in this version.

@Mgamerz Thanks for the update. I'm not actively maintaining this at the moment, but if someone reads this and opens a PR without looking at the GPL source I'd be happy to land it.

I have just created a PR to add support for the latest JojoDiff format. Note that since I discovered both janpatch and JojoDiff today, I have been very careful not to look at any part of the JojoDiff source code, so that there can't be any issue with the licensing.

For good measure, I have also updated blinky-k64f.patch to the latest JojoDiff format (but I have left blinky-k64f-reverse.patch in the old format). I have tested that both the new and old blinky-k64f.patch files produced the expected results.

Btw, I suggest adding a header with the license, author and a link to the project in janpatch.h, so that, when it is reused in another project, which is what I am planning to do, people can locate its source and licensing terms more easily.

Thanks again for creating janpatch!