package patdiff

  1. Overview
  2. Docs
File Diff using the Patience Diff algorithm

Install

Dune Dependency

Authors

Maintainers

Sources

v0.16.1.tar.gz
md5=ed1fd8166e2e99774432c1e28515f37e
sha512=7833f95ce42eeb17ecbef514eab13a37a0ab125b3c6e7e8af09c5b0efa3be6b971c6c4a40f3d809f1c254c8bc720ddaa46b54ff0514ddb9db0f5be03d99f5fd0

Description

Published: 06 Nov 2023

README

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 here 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 here.

Dependencies (9)

  1. re >= "1.8.0"
  2. dune >= "2.0.0"
  3. ppx_jane >= "v0.16" & < "v0.17"
  4. patience_diff >= "v0.16" & < "v0.17"
  5. expect_test_helpers_core >= "v0.16" & < "v0.17"
  6. core_unix >= "v0.16" & < "v0.17"
  7. core_kernel >= "v0.16" & < "v0.17"
  8. core >= "v0.16" & < "v0.17"
  9. ocaml >= "4.14.0"

Dev Dependencies

None

Used by (2)

  1. bonsai >= "v0.16.0"
  2. osnap < "0.3.0"

Conflicts

None