OmniDiff: Open-Source Rust Git Difftool with Content-Aware Comparison
Developer Ivan Kovic released OmniDiff, an open-source Rust-based Git difftool designed for fast and content-aware comparisons. The tool claims to handle 99.95% of code changes and optimizes accuracy and speed for diverse file types including code, images, and PDFs. Currently at v0.3.0, it is already usable as a daily driver.
Full Report
Contents9 sections
OmniDiff
Fast, robust, accurate content-aware diffing.
- Robust: can diff 99.95% of code changes
- Content-aware: 98.8% of changes diffed using content-specific algorithms
| Content | Fast: under 100ms | Accurate: perfect | Accurate: near-perfect |
|---|---|---|---|
| Code | 98% | 70% | 92% |
| Pictures | 96% | 69% | 91% |
| Cursors | 100% | 85% | 100% |
| Fonts | 95% | 82% | 100% |
| Archives | 88% | 87% | 87% |
| Message catalogs | 100% | 83% | 83% |
| PDFs | 57% | 100% | 100% |
Speed measured on a T14s, Intel Core i7-1370P with 32 GB RAM (see Fast). PDFs have fewer than ten judged test cases (see Accurate).
See it in the browser: twenty real code
changes, recorded from the command-line tool and compared side by side in Unix diff and in
OmniDiff, and content examples: an
OpenDocument file, a compiled translation catalog, and pictures, still and animated.

Various light and dark themes are available:

Files are diffed based on type. A PDF diagram with one box renamed, and a web font with twenty icons redrawn:


Installation
From source
cargo install --locked omnidiffThis command builds OmniDiff from source, with the dependency versions it was tested with. You
need a C compiler on PATH and a Rust toolchain, rustc 1.92 or later. The build compiles every tree-sitter grammar from C.
The first cargo install takes a few minutes, because of this and the lto = "fat" release
profile.
Prebuilt binaries
Prebuilt binaries for Linux, macOS (Intel and Apple Silicon), and Windows are attached to every GitHub release.
Homebrew
macOS and Linux:
brew install ivankovic/omnidiff/omnidiffDebian and Ubuntu
.deb packages for amd64 and arm64 are available in a signed apt repository:
sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://ivankovic.github.io/omnidiff/apt/omnidiff-archive-keyring.gpg \
| sudo tee /etc/apt/keyrings/omnidiff-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/omnidiff-archive-keyring.gpg] \
https://ivankovic.github.io/omnidiff/apt stable main" \
| sudo tee /etc/apt/sources.list.d/omnidiff.list > /dev/null
sudo apt update && sudo apt install omnidiffNix and NixOS
On NixOS, or anywhere with Nix installed:
nix run github:ivankovic/omnidiffIf flakes are not enabled in your Nix configuration, add
--extra-experimental-features 'nix-command flakes' after nix.
Arch and Gentoo
Recipes for Arch and Gentoo live in packaging/: the PKGBUILD builds locally with
makepkg -si, and the Gentoo ebuild is ready for an overlay. The two distros are overwhelmed and
their repositories open and close to new packages sporadically.
Editor integration
VS Code does not yet let an extension replace its built-in diff view. The API is implemented upstream but unreleased; the extension will adopt it when it ships.
- VS Code - omnidiff-vscode. Search for
OmniDiff in the Extensions view, or
code --install-extension ivankovic.omnidiff. Also on Open VSX for VSCodium, Cursor and Windsurf. - Neovim - omnidiff.nvim.
Using OmniDiff
The interactive TUI
omnidiff # open an empty viewer; press o to pick each file
omnidiff BEFORE AFTER # open directly into the diff of two filesPress ? in the viewer for the full list of keybindings.
The TUI uses 24-bit color when the terminal advertises it with COLORTERM=truecolor, and the
nearest 256 colors otherwise (macOS Terminal.app, or most terminals over ssh, which does not
forward COLORTERM). If your terminal supports 24-bit color but does not advertise it, run
export COLORTERM=truecolor.
In a browser
For reviewing changes in a browser, see codereview.
Note: codereview is at v0.0.0; use it at your own risk.
(注:更多技术实现细节与完整 API 文档请查阅原项目 README)
作者发帖说明(HN):
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.