Introduction
dwdiff is a front-end for the diff program that operates at the word level instead of the line level. It is different from wdiff in that it allows the user to specify what should be considered whitespace, and in that it takes an optional list of characters that should be considered delimiters. Delimiters are single characters that are treated as if they are words, even when there is no whitespace separating them from preceding words or delimiters. dwdiff is mostly commandline compatible with wdiff. Only the --autopager, --terminal and --avoid-wraps options are not supported.
The default output from dwdiff is the new text, with the deleted and inserted parts annotated with markers. Command line options are available to change both what is printed, and the markers.
dwdiff is Licensed under the Open Software License version 2.0. See the file COPYING for details.
Motivation
I wrote dwdiff because when diff'ing C code with wdiff, wdiff would often find differences that were larger than I wanted. For example, when one modifies the function header of a program:
void someFunction(SomeType var)
into
void someFunction(SomeOtherType var)
wdiff would say that "someFunction(SomeType" was replaced by "someFunction(SomeOtherType", while what I wanted it to say was that "SomeType" was replaced by "SomeOtherType".
Prerequisites and installation
dwdiff is a front-end for diff, so the diff utility should be available. The Makefile will test for -a (assume input is text) and -i (compare caseinsensitively) options. If they are not available (these options are not in the POSIX specifications) work-arounds will be enabled. If a diff command is available that does provide these options but under a different name, one can use "make DIFF=<command>" to specifiy an alternative name for the diff command.
Should the tests in the Makefile find incorrect settings for the availability of the -a and -i options, you should copy config.h.tmpl to config.h and edit config.h to match your situation.
The Makefile in the distribution should work on all POSIX compatible make's. I have tested it with both GNU make and BSD make.
dwdiff uses several POSIX functions, namely: popen, pclose, umask, mkstemp and fdopen. dwdiff should compile on any Un*x system that provides these functions.
To compile, simply run "make". For installation, use "make install" as root. By default dwdiff is installed in /usr/local. To install in another directory, use "make prefix=<prefix> install".
Reporting bugs
If you think you have found a bug, please check that you are using the latest version of dwdiff [http://os.ghalkes.nl/dwdiff]. When reporting bugs, please include a minimal example that demonstrates the problem.
Author
Gertjan Halkes <dwdiff@ghalkes.nl>
