Code Monkey home page Code Monkey logo

patdiff's Introduction

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

screenshot

good word-level diffing out of the box

screenshot

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.

patdiff's People

Contributors

aalekseyev avatar bcc32 avatar bmillwood avatar lpw25 avatar trefis avatar vch9 avatar xclerc avatar ysulsky avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.