RC RANDOM CHAOS

OmniDiff: Content-Aware Git Diff Tool Written in Rust

· via Hacker News

Original source

Show HN: OmniDiff – Opensource, super fast, content aware Git difftool, in Rust

Hacker News →

OmniDiff is an open-source Git difftool written in Rust that takes a content-aware approach, using content-specific algorithms to intelligently diff various file types. The tool claims to diff 99.95% of code changes, with 98.8% using content-specific algorithms rather than generic line-by-line comparison. This approach produces meaningful diffs not just for source code but also for PDFs, archives, fonts, compiled translation catalogs, and OpenDocument files—formats that conventional diff tools typically cannot handle.

OmniDiff can be installed via cargo, prebuilt binaries, apt repositories with GPG signature verification, Nix, and distribution-specific packages for Arch and Gentoo. It integrates with Git both as a configured difftool and through the GIT_EXTERNAL_DIFF environment variable. The tool also provides a VS Code extension (currently limited because the API cannot yet replace the built-in diff viewer) and a Neovim plugin, plus configuration support for jj version control.

The tool detects 25 languages by file extension and falls back to basic diffing for unknowns. It offers both an interactive terminal UI and a headless mode for scripts and CI pipelines. The TUI adapts to terminal capabilities, supporting 24-bit color or 256-color fallback. Key features include preserving three lines of context around changes and automatically displaying the containing function, class, or struct for deep changes. Additional options include JSON output, configurable exit codes, and color control via environment variables.

Read the full article

Continue reading at Hacker News →

This is an AI-generated summary. Read the original for the full story.