News for hackers. Stuff that matters.
Re:Show HN: OmniDiff – Opensource, super fast, content aware... by davvid on Sunday November 01, 2026 @02:55PM (#50329116)
Nicely done OP. Does it do 3-way diffs for merges as well? The instructions only mention the two-way `git difftool` configuration so maybe that'll be a future feature?

Any interest in getting the setup upstreamed[1] so that users only need to `git config --global diff.tool omnidiff` to enable it by default? Disclosure: I created `git difftool` a long time ago, and am always happy when builtin support for useful tools are added to it. Feel free to reach out if you'd like help making that happen.

[1] https://github.com/git/git/tree/master/mergetools

Re:Show HN: OmniDiff – Opensource, super fast, content aware... by FabCH on Sunday November 01, 2026 @03:14PM (#50329292)
At the moment the algorithm for code diffing is a particularly efficient implementation of APTED which is a tree diffing algorithm that doesn’t natively construct anything useful for a three way diff. I have a notebook with a bunch of failed attempts at a good algorithm for a three way merge, but so far nothing particularly impressive.

It’s a long term goal to solve, but it’s the hardest one.

I’ll definitely reach out to you to upstream. Thank you for the kind offer!

Re:Show HN: OmniDiff – Opensource, super fast, content aware... by catlifeonmars on Sunday November 01, 2026 @08:14PM (#50331827)
[delayed]
Re:Show HN: OmniDiff – Opensource, super fast, content aware... by FabCH on Monday November 02, 2026 @01:21AM (#50333695)
It’s a 5 step pipeline.

In practice, tree hashing is doing a huge amount of work because most diffs are tiny. Half of all diffs are less than 10 lines, so a hash can extremely quickly match large subtrees.

In a profoundly degenerate case of a C++ header file with only a 20MB array of bytes, it detects a degenerate tree and uses Myers O(N) sequence diffing algorithm instead of treating it as a tree.

Re:Show HN: OmniDiff – Opensource, super fast, content aware... by catlifeonmars on Monday November 02, 2026 @07:43AM (#50336070)
How would one craft an input that maximizes the runtime of your diff while staying below some (reasonable) bound of edit distance apart? Basically suppose I wanted to provide a malicious diff designed to hang or timeout the diff program, how would I construct it?
Re:Show HN: OmniDiff – Opensource, super fast, content aware... by FabCH on Monday November 02, 2026 @08:38AM (#50336657)
You need to maximize the size of the residual tree sent to the final APTED step.

I actually don’t know how to do that and stay under a bounded edit distance.

Alternatively, you can crash it if you just encode the entire “Star Trek - In the pale moonlight” episode as a sequence of bytes in a const int array in C++.

Re:Show HN: OmniDiff – Opensource, super fast, content aware... by catlifeonmars on Monday November 02, 2026 @08:56AM (#50336857)
> I actually don’t know how to do that and stay under a bounded edit distance.

I’m sure there’s an interesting result there, but I am not the person to find it :D

Good episode btw