Patdiff
File Diff using the Patience Diff algorithm. https://opensource.janestreet.com/patdiff/
Install / Use
/learn @janestreet/PatdiffREADME
Patdiff - colored patience diffs with word-level refinement
Patdiff is an OCaml implementation of Bram Cohen's patience diff algorithm, with a few extra conveniences for comparing code and config files:
outputs plain ASCII, ANSI color codes, or HTML
optional semantic diffing of numbers

good word-level diffing out of the box

And of course all the usual features:
- recursive diffing of directories
- extensively configurable output (markers, colors, location format, context)
- whitespace-aware diffing
Installation
opam install patdiff
See <a href="https://github.com/janestreet/patdiff/blob/master/patdiff.opam" target="_blank"> here</a> for Patdiff's opam package file.
Compiling from source
To build patdiff for local development, install its dependencies:
git clone https://github.com/janestreet/patdiff
cd patdiff
opam install --deps-only .
To compile, and optionally install, patdiff:
make
make install
Usage
patdiff old-file new-file
If you don't supply any arguments to patdiff, it will read diff-like text from stdin and color it in the normal patdiff way.
The file ~/.patdiff is used as a config file if it exists. You can
write a sample config with the -make-config flag.
patdiff-git-wrapper
A simple wrapper is provided for using patdiff as git's "external diff" tool. You can enable it with:
export GIT_EXTERNAL_DIFF=$(command -v patdiff-git-wrapper)
or
git config --global diff.external $(command -v patdiff-git-wrapper)
Documentation
More docs, including detailed API docs, are available <a href="https://ocaml.janestreet.com/ocaml-core/latest/doc/patdiff/index.html" target="_blank">here</a>.
Related Skills
node-connect
338.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
338.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.6kCommit, push, and open a PR
