Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

78 lines (45 sloc) 1.777 kb



di - a wrapper around GNU diff(1)


The di(1) command wraps around GNU diff(1) to provide reasonable default settings and some original features:

- Useful options turned on by default: -U3 -N -p -d.

- Diff output is colorized, and paginated by user's favorite pager.

- Non-significant files are ignored by default, such as backup
  files, object files, VCS administration files, etc. a la
  rsync(1)'s --cvs-ignore option.

- Ignore difference of lines containing RCS tags.

- Perform recursive comparison.

- Support combinations of command line options that GNU diff(1) is
  expected to but does not support.

- Default set of options are configurable via environment variable.

- Any option can be negated from a command line. (Specify -N- to
  negate the default -N, etc.)


Run di –help for help.


Just use di(1) for diff(1) as a wrapper.

There are a few occations you shouldn't simply substitute di(1) for diff(1). For example, svn calls the external diff for each changed file, so the pagination enabled by default would be annoying.

In such a case, you can have a non-paginating version of di as below:

# Give it another name
ln di ndi

# Set default options for the new command; put these lines in your
# shell's startup file

Then set diff-cmd to the new command in ~/.subversion/config.

diff-cmd = ndi


  • Ruby 1.8.7 or later

  • GNU diff(1)


gem install di

Or just install lib/di.rb as “di” to a directory in your PATH.


Copyright © 2008, 2009, 2010, 2011, 2012 Akinori MUSHA

See LICENSE for license terms.

Jump to Line
Something went wrong with that request. Please try again.