Hacker News new | past | comments | ask | show | jobs | submit login
Diffoscope – In-depth comparison of files, archives, and directories (diffoscope.org)
141 points by jiripospisil 7 months ago | hide | past | favorite | 14 comments



When I was working on Othernet (www.othernet.is), I wanted to do Over-The-Air updates of our firmware. Over a unidirectional, slow (~20kbps), broadcast satellite link with significant packet dropout this was quite a challenge. Amongst the many tools that helped in making it work was diffoscope. I used it to make our buildroot-based firmware have deterministic, minimal-diff build, thus reducing the amount of update I needed to send out.

For a few weeks, I simply iterated between building the firmware, using diffoscope to diff the new build against a previous build to find what files changed and where, fix buildroot packages to eliminate these file changes whereever possible, lather-rinse-repeat.

In the end I was able to reduce our OTA update sizes to a typical 20-50KB (base, compressed firmware image as 30MB).

Fun times!


> In the end I was able to reduce our OTA update sizes to a typical 20-50KB

What was the original size before you started this process?


It's surprising how often projects retag releases. Diffoscope makes it easy to see the difference between the original tarball and the retagged versions.

Changes vary from from forgetting to update an in-source version to tagging the wrong commit to fixing file metadata (file owner in the tarball).


If you want to try this without any setup, https://try.diffoscope.org/ is a nice web interface to it.


It looks like it uses a Wagner–Fischer algorithm to find the diffs. I think it would be nice if that is mentioned in the documentation. In formats that are not order dependent the algorithm can't find a good comparison because no generic algorithm can without more input.


Diffoscope is used extensively by the Debian reproducible builds project to compare software build artifacts and find how they differ.


nice, i like the tree view.

I have been using beyond compare for this sort of thing for longer than i can remember though.

Edit: actually, bc has different features.


Meld can also compare directories


For those not familiar with meld:

https://gitlab.gnome.org/GNOME/meld/

There is a GitHub repo of it that is now deprecated, this is apparently the official repo. I’m curious how these stack up to other, similar tooling, but for now I’m starting to wonder how much work it would take to modify GNOME Sushi [1] to call one of these utilities when two items are selected in the GNOME Nautilus file manager, and go one step beyond macOS Quick Look (though we would still be missing the Quick Look powerful editing capabilities).

[1] https://www.omgubuntu.co.uk/gnome-sushi-mac-quick-for-ubuntu


I'm currently working on comparing 2 directories of around 3000 JSON/YAML files each, and while meld can open the diff viewer in a few seconds, diffoscope can't seem to process them.

I love meld, makes my life so much easier :3

EDIT: diffoscope got unstuck after some minutes, but I still prefer the default GUI viewer from meld.


Can’t get meld to work on macos anymore :(


After quite a bit of experimenting, I'm aware of two decent ways to run Meld on an M1 Mac:

https://gitlab.com/dehesselle/meld_macos/-/releases (very new, discussed in the official gitlab meld repo issue https://gitlab.gnome.org/GNOME/meld/-/issues/804)

https://gist.github.com/syneart/4a8724cd479d31f0f742f499f807... for the older but more integrated Meld for MacOS


I recommend Meld as well. I have used it for years and it has aged very well.


So does kompare.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: