NAME 

cdiff - show diffs with colors

SYNOPSIS 

cdiff [-m ] [diff ... ]

DESCRIPTION 

cdiff reads a unidiff or context diff from stdin or a set of (optionally compressed) files and URLs, adds color codes, expands tabs to 8 spaces, and passes the results to less(1). If used on a color terminal, it makes diffs much easier to read. There is also handling of "cvs annotate" in it.
-m
Use bold, reverse and underline codes (for monochrome terminals).
CDIFFCOLORS
The color codes used to add. Default is 1:34:31:35, for lines begin with "@", "-", "+" and "!".

AUTHORS 

cdiff was written by An Eivind Eklund Aq eivind@FreeBSD.org . based on a sed line somebody passed around. The code is (much) smaller than this man page.

SEE ALSO 

diff(1), less(1), cvs(1).

BUGS 

cdiff assumes standard ANSI color escape sequences (as used by xterm and most other commonly used terminals), rather than using curses(3).

cdiff should really be a large and complex C program based on less(1) and a diff library. This would allow a more informative display, including collapsing pure deletions/insertions inside a single line to one line with colors for deleted/added material, avoiding the line-wrap problems in less due to less not knowing the effects or lengths of the color escape codes, and correct handling of shifted tabs (instead of just expanding them to spaces.)