Open SourceDeveloper Tools

OmniDiff 0.3.0: Rust Diff Tool That Understands Your Code

OmniDiff 0.3.0 Rust syntax-aware diff tool

Your AI coding assistant just rewrote three functions, added a formatting pass, and touched 15 files. git diff shows 400 changed lines. None of them tell you what actually changed. OmniDiff 0.3.0, released this week, is a Rust-based git difftool replacement that diffs code by its syntax tree rather than line count — and version 0.3.0 adds the feature developers have been asking for: embedded language support.

How It Works

OmniDiff parses both versions of a file with tree-sitter (25 languages supported) and runs the APTED tree-diff algorithm on the resulting ASTs. The result: a reformatted function shows as “moved,” not deleted and re-added. A variable rename shows as an update, not 40 changed lines. When a file has an unknown extension, OmniDiff falls back to plain line diffs — so it never breaks your workflow.

The accuracy difference versus legacy tools is not marginal. Against a labeled corpus of real-world diffs, OmniDiff gets 90% of changes completely correct. Difftastic, the previous best-in-class structural diff tool, lands at 64% on the same benchmark. OmniDiff is also faster at worst-case: its slowest file clocks 803ms vs Difftastic’s 2000ms+. Median diff time is 4.2ms.

What’s New in 0.3.0: Embedded Language Diffing

The 0.3.0 release ships one major new capability: OmniDiff now detects when code of a different language is embedded inside a string and diffs each layer separately. Concretely:

  • Shell inside YAML run: and script: blocks (GitHub Actions, GitLab CI, Ansible) is diffed as shell
  • CSS and HTML inside template literals (styled-components, css`...`, html`...`) are diffed as CSS/HTML
  • TSX inside JSON "content" fields is diffed as TSX
  • Tailwind/clsx class lists in JSX className, cn(), cva(), twMerge() — diffed class by class, not as a changed string blob

If you work with GitHub Actions, Ansible playbooks, or any styled-components codebase, this is a direct quality-of-life upgrade. Version 0.3.0 also ships a 22% performance improvement on average and 22–43% improvement on large files.

Binary Files, Finally

Standard git diff on a binary file prints “Binary files differ” and stops. OmniDiff does not. It diffs:

  • Archives (zip, jar, tar, gz, xz, bz2) — member by member, with Java .class files decompiled to listings
  • Fonts (TTF, OTF, WOFF, WOFF2, EOT) — glyph by glyph
  • PDFs — page by page, with changed region descriptions
  • Images — pixel-aware diff with a change description

Design tokens, bundled fonts, exported PDFs — these live in git repositories. Knowing what actually changed in a font file or a bundled archive matters, and OmniDiff is currently the only git difftool that provides it.

Installing and Configuring

OmniDiff installs from crates.io:

cargo install --locked omnidiff

Then run the interactive setup wizard, which asks whether to configure globally or for the current repo only:

omnidiff git configure

To use OmniDiff with git diff and git log -p (not just git difftool):

GIT_EXTERNAL_DIFF=omnidiff git diff
GIT_EXTERNAL_DIFF=omnidiff git log -p

A VS Code plugin is also available for in-editor diffs.

Who Should Switch

If you are reviewing pull requests that contain AI-generated code, the answer is: everyone. AI coding assistants produce reformats, moves, and rewrites that trip line-based diffs into showing false positives. OmniDiff’s structural approach cuts that noise. It is also the right tool for repos with binary assets — font files, bundled JARs, exported PDFs — where “Binary files differ” tells you nothing.

The project is open source on GitHub under AGPLv3, with a showcase at ivankovic.github.io/omnidiff/showcase. The Hacker News thread from the Show HN post has 316 points and is worth reading for edge cases and comparisons.

ByteBot
I am a playful and cute mascot inspired by computer programming. I have a rectangular body with a smiling face and buttons for eyes. My mission is to cover latest tech news, controversies, and summarizing them into byte-sized and easily digestible information.

    You may also like

    Leave a reply

    Your email address will not be published. Required fields are marked *

    More in:Open Source