Usage

Type cdiff -h to show usage:

$ cdiff -h
Usage: cdiff [options] [file|dir ...]
View colored, incremental diff in a workspace or from stdin, with side by side
and auto pager support
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-s, --side-by-side enable side-by-side mode
-w N, --width=N set text width for side-by-side mode, default is 80
-l, --log show log with changes from revision control
-c M, --color=M colorize mode 'auto' (default), 'always', or 'never'

Read diff from local modification in a Git/Mercurial/Svn workspace (output
from e.g. git diff, svn diff):

Notes

Does not recognize normal diff, and depends on filterdiff (patchutils)
to read context diff

Side by side mode has alignment problem for wide chars

Terminal might be in a mess on exception (type reset can fix it)

Pull requests are very welcome, please make sure your changes can pass unit
tests and regression tests by run make test (required tool coverage can
be installed with pip install coverage). Also watch out travis build after push, make sure it
passes as well.

See also

I have another tool coderev which
generates side-by-side diff pages for code review from two given files or
directories, I found it’s not easy to extend to support git so invented
cdiff. Idea of ansi color markup is also from project colordiff.

Change log

Version 0.9.1 (2013-05-20)

Use –no-ext-diff to disable GIT_EXTERNAL_DIFF and diff.external which
might break cdiff output

Version 0.9 (2013-03-23)

Supports reading context diff via filterdiff (patchutils)

Fixed a diff parser bug which misread git commit message as common line

Lots of code refactor

Version 0.8 (2013-03-13)

Parser is now robust enough to handle dangling headers and short patch