Delta has a really nice way to show diffs with its diff-so-fancy mode, it's more similar to GitHub's UI where not only the line is colored up differently but there's a different shade of color to highlight the characters.
In OmniDiff's readme and web version I didn't see a way to do that.
In a different comment you mentioned OmniDiff is much better than Delta and you mentioned "About a third of diffs are significantly better.". Can you provide some examples of these? I've never seen Delta fail a diff.
Also Delta has a package for Arch in its official repos. For folks who just want a "it works" experience, that's a pretty big win. With Delta the same package can be installed in the same way on Debian, Arch and macOS with Brew using standard package managers. With OmniDiff, there's 3 different ways to install it (manual deb package on Debian, manual package compile on Arch and brew install on a Mac). Just something to think about, as someone who has public dotfiles that work in those 3 environments, I'd skip OmniDiff based on this alone.
OmniDiff is character based by default. It will only highlight the changed characters. I suppose I could add an option to additionally highlight the line as well. Thanks for the feedback!
As for packaging. Unfortunately AUR is closed at the moment due to spam. I can add brew commands for Linux, happily.
In terms of “better”. It’s actually somewhat complex, but a simple way to think about it is that if you move a function up or down in the same class, text-based diffs paint that as “Deleted here, Inserted there” where ideally you would want it to say “Moved”.
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?
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.
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.
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.
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.
> 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.
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.
> 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.
Delta has a really nice way to show diffs with its diff-so-fancy mode, it's more similar to GitHub's UI where not only the line is colored up differently but there's a different shade of color to highlight the characters.
There's a screenshot and video of it here that I wrote a while back: https://nickjanetakis.com/blog/awesome-git-diffs-with-delta-...
In OmniDiff's readme and web version I didn't see a way to do that.
In a different comment you mentioned OmniDiff is much better than Delta and you mentioned "About a third of diffs are significantly better.". Can you provide some examples of these? I've never seen Delta fail a diff.
Also Delta has a package for Arch in its official repos. For folks who just want a "it works" experience, that's a pretty big win. With Delta the same package can be installed in the same way on Debian, Arch and macOS with Brew using standard package managers. With OmniDiff, there's 3 different ways to install it (manual deb package on Debian, manual package compile on Arch and brew install on a Mac). Just something to think about, as someone who has public dotfiles that work in those 3 environments, I'd skip OmniDiff based on this alone.
OmniDiff is character based by default. It will only highlight the changed characters. I suppose I could add an option to additionally highlight the line as well. Thanks for the feedback!
As for packaging. Unfortunately AUR is closed at the moment due to spam. I can add brew commands for Linux, happily.
In terms of “better”. It’s actually somewhat complex, but a simple way to think about it is that if you move a function up or down in the same class, text-based diffs paint that as “Deleted here, Inserted there” where ideally you would want it to say “Moved”.
Really well done, I like this a lot. It produces much more minimal diffs than other tools I've tried.
One feature I miss from difftastic is showing diffs side-by-side on wide terminals, and unified when narrow.
It should… it considers wide to be 200+ columns.
You can force it with “v”.
I am not super set on that value, if the community has a better default for “wide”, happy to modify it.
Older submission: https://news.ycombinator.com/item?id=49891989
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.
How does it compare with diffstatic?
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.
> 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?
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.
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.
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.
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...
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.
> 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.
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.
> 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.
How is it better or worse compared to https://github.com/dandavison/delta ?
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.
Okay, I'll give it a try then.