Top
Best
New

Posted by FabCH 21 hours ago

Show HN: OmniDiff – Opensource, super fast, content aware Git difftool, in Rust(github.com)
I have been researching what the ultimate diff tool would look like, based on actual diffs in open source repositories.

OmniDiff can diff: code (25 languages), config, images, PDFs, archives, cursors, fonts...

It's fast. It can diff C++ files of tens of thousands of lines in under 100ms, on a 2023 ThinkPad T14s.

It's open source. AGPLv3.

It's based on real diffs. I looked at the 7400 repositories that are listed in Gentoo packages, sampled 2000 diffs and solved them manually to get a good understanding of what is needed, before putting together the diff pipelines for each content type. Incidentally, this also forms the basis of the CI pipeline, so the robustness of the codebase is quite high.

I'm still developing it. It's v0.3.0 at this time. But I have been using it daily as my git difftool for months now, and it works well.

AI Disclosure: Yes, I do use AI. No, I do not vibecode.

240 points | 68 commentspage 2
cocoto 18 hours ago|
How does it compare with diffstatic?
FabCH 18 hours ago|
Comparing is slightly complicated but roughly speaking:

Difftastic only diffs code, which is only 2/3 of all diffs.

When only measured on stuff difftastic supports:

Difftastic is perfect on 64% of diffs and near-perfect on 17% more.

Omnidiff is perfect on 90% of diffs and near-perfect on 5% more.

Speed is

p50 - 35ms difftastic vs 4ms OmniDiff p99 - 637ms vs 420ms

Difftastic wins on license. MIT vs AGPL.

LVB 16 hours ago||
> Difftastic wins on license. MIT vs AGPL.

I'm a little confused on that, since in other comments you've mentioned that AGPL was a deliberate choice for <reasons>. So, what's the definitions of "winning" here?

FabCH 16 hours ago|||
It was a tongue-in-cheek joke :)

But it was worth pointing out the difference in license, it is one of the ways in which the projects differ.

folmar 10 hours ago|||
The more permissive MIT is often an advantage if you want to build it into something bigger, which is reasonable for diff tool.

Discrete users would arguably win more with integrity of AGPL, but developers have reasons to prefer MIT.

fishgoesblub 8 hours ago|||
> but developers have reasons to prefer MIT

Hi! as a developer, I personally prefer it when the libraries/tools used in my projects are GPL or another Copyleft license. The drove of MIT projects from the past decade has been depressing.

lejalv 2 hours ago|||
Servitude to their masters
anilgulecha 18 hours ago||
You have a good core idea here. You're pretty much killing your project in infancy with the AGPL+donation license model. Meanwhile, some other projects will take the core idea of "language aware differ" and release BSD, and one of those will win, including perhaps making it into git/future version controls.

IMO, you should seek to make this a standard that wins, and hopefully other opportunities that come will be where you make commercial hay. My unsolicited 2c.

FabCH 18 hours ago||
I really do care about copyleft and AGPL. It’s a political choice. I specifically chose it because I know from direct experience that big tech is allergic to it.

I actually don’t care about the commercial license. It’s more of an experiment for my own amusement than an actual attempt at building a commercial project.

If it inspires someone to build another one and we still end up with a better differ, I’m ok with that world. As long as the open source community has a better differ.

Note that there already are at least 3 that I am aware of. But they do perform worse on speed and accuracy.

ipsi 18 hours ago|||
FWIW, there's probably no point in using a copyleft licence if AI is involved[1][2], unless you've got pretty solid proof AI only "assisted" rather than doing the bulk of the work. Otherwise, you don't have copyright on the generated code, and without copyright the licence is meaningless, AFAIK.

This is not to say you can't or shouldn't use AI, but it's important to understand the tradeoffs you're making.

[1] https://www.scotusblog.com/cases/thaler-v-perlmutter/ [2] https://www.jenner.com/en/news-insights/client-alerts/us-cop...

FabCH 18 hours ago|||
I’m not based in the US so SCOTUS doesn’t set meaningful precedent for my IP.

That said, even under those rules, I would be comfortable arguing before the court that this code has significant human involvement and easily passes the copyright standard.

It’s also why I don’t think someone can just easily create another one and license it under BSD. My code is AI assisted, but all truly important pieces were human made.

dspillett 16 hours ago||
> It’s also why I don’t think someone can just easily create another one and license it under BSD. My code is AI assisted, but all truly important pieces were human made.

Get one AI to describe what the code does, and another to implement based on that description. You might even get away with a human doing one of the steps. A variation of the classic “clean room reverse engineering” method that was used by Compaq to reimplement IBM's BIOS and start the clone PC market.

Some argue that “it doesn't work like that” but it certainly seems to be what some people are doing and as yet no one has been confident enough that their copyright extends through this mechanism that they've tested the theory in court.

Note: I'm not saying it is right, but that it might well be perfectly legal. It is definitely possible, practical even. I'd still release stuff under AGPL/similar for the same reasons stated above, but I'd not operate under any illusion that I'd be safe from someone using that method to copy everything they wanted to.

FabCH 16 hours ago||
If an individual went through all this effort just to release it under MIT, I’d honestly be mostly just surprised someone cared so much. I’d probably just send them my own project relicensed under MIT out of pure curiosity.

But I am counting on the fact that _companies_ would be too worried about legal uncertainty to try this.

dspillett 13 hours ago||
> I am counting on the fact that _companies_ would be too worried about legal uncertainty to try this

Oh, my sweet summery child :-)

Companies have been doing far more dodgy things, things that look objectively illegal where-as the clean-room reverse engineering thing looks to me (caveat: not a legal expert at all) to be legally defensible, for a long time, definitely pre-AI.

Even if a company operating in your jurisdiction, where you as an individual might have a cat in hell's chance of even trying to sort the situation to your preference, might not, you can bet your last <currency unit> that a company elsewhere will feel more free to do so if they wanted what you have without agreeing to your terms.

FabCH 1 hour ago||
I’m perfectly happy to defend the copyright in the EU/EFTA and CAN/US.

If it’s a small company, it’s not worth it, but then again they are not causing a lot of damage either. If it’s a big company, they will find me unexpectedly resistant to usual legal bullying tactics. I have legal insurance, multiple lawyers as friends and don’t have a job so have loads of time for filing paperwork.

noir_lord 12 hours ago|||
You are assuming OP is in the US.

Though AI code copyright is an unknown pretty widely either way, it's too new for the legal system to have caught up with it yet.

FabCH 1 hour ago||
The CH in FabCH stands for Switzerland :)

… we don’t know what to do with AI copyright either. I assume a referendum will sort it out at some point.

shock 15 hours ago|||
I support the choice of AGPL. I wish more software used it. Whenever I use AI to write code, in my experience it invariably chooses the MIT license. For example, for all the ansible roles that I've written using AI it put the MIT license in the meta file, unless otherwise prompted. It makes me wonder if it comes from RLHF.
IshKebab 17 hours ago||
> Meanwhile, some other projects will take the core idea of "language aware differ" and release BSD, and one of those will win, including perhaps making it into git/future version controls.

Diffsitter and Difftastic have been around for a while, both MIT, so I doubt it.

paaloeye 20 hours ago||
How is it better or worse compared to https://github.com/dandavison/delta ?
FabCH 20 hours ago|
It’s much much better with moved code.

Delta adds color to the standard git diff algorithm.

Omnidiff uses a completely different algorithm.

About a third of diffs are significantly better.

eviks 1 hour ago|||
Do you have any examples illustrating how it's better?
paaloeye 20 hours ago|||
Okay, I'll give it a try then.
paaloeye 20 hours ago||
Older submission: https://news.ycombinator.com/item?id=49891989
FabCH 20 hours ago|
Not quite.

In the meantime, I added support for all other non-code file formats. Hence the name change.

It’s quite a big chunk of functionality.

smallnix 13 hours ago||
Very cool! I'd love to see support for figma or Photoshop, perhaps it's already possible via export to an image format, but native would be cool.
FabCH 13 hours ago|
Depending on how proprietary their formats are, it could be done.
burner-account 13 hours ago||
I am sorry, I looked through the examples and I am not sure I prefer the output of omnidiff... Seeing how everyone else over here is instead overly enthusiastic makes me feel extremely dumb :D
FabCH 1 hour ago||
Don't feel dumb. You are just an outlier on the visual preferences.

I actually do TWO solutions for each test case: a minimal diff and a maximal diff. Pressing 'm' in the TUI pops up a settings page where you can choose how the diff works.

I am actively researching how many ways there are to "paint" the same diff and user preferences and non-uniqueness of diffs is something I am super interested in.

If you would like to, it would be super useful for me to know what diff you don't like and why. It would help make the diff better for users with different visual preferences.

keepupnow 7 hours ago||
[dead]
paravz 10 hours ago||
[dead]
keepupnow 7 hours ago||
[dead]
Surac 18 hours ago||
[flagged]
hebetude 18 hours ago|
[flagged]
cassianoleal 17 hours ago||
> with licenses nobody wants to use

Nobody wants to use AGPL-v3?

https://github.com/ivankovic/omnidiff/blob/main/LICENSE

fishgoesblub 12 hours ago||
Some people think there's no point if you're not allowed to steal the code and not give back
roarcher 6 hours ago||
How can one be allowed to steal something? Then it is by definition not stealing.
alexpadula 17 hours ago||
You know hebetube, my mother once said "if you have nothing nice to say: don't say it". You saying those things probably aren't going to make them turn over the license. "Project dead before it started" like who writes those kinds of things over someones work they spent time on. I'd love for you to explain your logic.