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 NDI_OPTIONS=--no-pager export NDI_OPTIONS
Then set diff-cmd to the new command in ~/.subversion/config.
[helpers] 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, 2013 Akinori MUSHA
See LICENSE for license terms.