HotNews Daily

Developer Releases OmniDiff, a Content-Aware Git Difftool Built in Rust

2026-11-01 13:02 · source: Hacker News · lang: en

An open-source and content-aware Git difftool written in Rust, called OmniDiff, has been introduced at version 0.3.0. The developer built the tool after researching what an ultimate diff utility should accomplish, using a methodology that examined actual differences found in open-source repositories. Specifically, the creator analyzed 7,400 repositories listed within Gentoo packages, sampling 2,000 distinct diffs and resolving them manually. This research informed the creation of customized diff pipelines for various content types, and the resulting dataset also serves as part of the project’s continuous integration pipeline to maintain code robustness.

OmniDiff relies on content-specific algorithms for the vast majority of its comparisons. The software is designed to handle a broad array of file formats, including code across 25 different languages, configuration files, images, PDFs, archives, cursors, and fonts. Emphasizing performance, the utility can process C++ source files containing tens of thousands of lines in under 100 milliseconds when tested on a 2023 ThinkPad T14s equipped with an Intel Core i7-1370P processor and 32 gigabytes of RAM. The developer notes that the tool has been utilized daily as a personal Git difftool for several months.

The application features a terminal user interface (TUI) that supports 24-bit true color when terminals advertise the capability via the COLORTERM=truecolor environment variable, falling back to 256 colors otherwise. To aid navigation in large files, OmniDiff automatically collapses long stretches of unmodified text while preserving three lines of context on each side of a modification, matching standard unified diff conventions. Furthermore, the software displays the nearest enclosing struct, class, or function line as a prefix for each hunk whenever that defining scope line is not already visible.

For automation and scripting purposes, OmniDiff includes a headless mode—also usable via the --batch flag—which outputs plain text with optional color rather than launching the interactive TUI. This mode activates automatically whenever standard output is redirected or piped, such as when sending output to a file or viewing it through less. The tool adheres to standard exit code conventions, returning zero on success and two upon encountering an error, while supporting an optional --exit-code flag to return one if file differences are detected.

Users can install OmniDiff through several channels. Building from source requires a Rust toolchain (version 1.92 or newer) alongside a C compiler on the system path, compiled via Cargo. Prebuilt binary releases are provided via GitHub for Linux, Windows, and macOS across both Intel and Apple Silicon architectures. Additionally, signed .deb packages for amd64 and arm64 are hosted in a dedicated repository, while packaging recipes exist for Arch Linux and Gentoo. Editor integration is also available; an extension for VS Code, VSCodium, Cursor, and Windsurf can be installed directly from the respective extension marketplaces to support the tool once upstream APIs are fully released.

Sources: Hacker News


Aggregated summary. Original: Hacker News