Contrast 0.2

This page is hosted by SourceForge: see also the Project and Statistics pages.

contrast: v. to compare in order to show unlikeness or differences.

The contrast tool is used to compare files, token by token.

You could support this project with a donation.

Compare Files Token by Token

You know how it is, you want to fix a bug in some code, but you have to run it through indent(1) first, just to keep your sanity. When it comes time to send a patch to the maintainer, you can't use diff(1) because indent changed every line.

The contrast tool can show you a graphical diff, like tkdiff(1) or mgdiff(1), but it works token by token, rather than line by line. This means that indent's changes to the white space are ignored.

That doesn't help you, even though you can see the just differences you made, because your bug fix still isn't in the maintainers format. There is a second tool which can effectively run indent backwards: The contrast-reformat(1) tool is used to apply one file's format to a second file. So, once you have the bug fixed, you can re-apply the original file's insane formating (the white space between the tokens) to to your bug fixed version. Now you can use regular diff(1) to build the patch.

Full credit for this brilliant idea belongs to Erik de Castro Lopo.


There is internals documentation in the file headers. This is extracted by Doxygen and turned into cross referneced HTML files.



You can obtain this software several ways, either as source code or as pre-compiled binaries.


The Master Sources

You can dowenload the following files from this web site:

File Name Description
contrast-0.2.README The README file from the tar distribution.
change_log.txt The release notes describing the changes in this version.
contrast-0.2.lsm Brief description in LSM format.
contrast-0.2.tar.gz The complete source.
contrast-0.2.pdf Contrast Reference Manual, in Adobe Acrobat format. The complete project, as a single Aegis change set.



As your first choice, get the tarball from the SourceForge mirror service, it will be faster than the other links on this page.

See also the SourceForge Project and Statistics pages.


Ubuntu Packages

If you use Ubuntu Linux, there are pre-built packages available for installation using the normal sudo apt-get install method, from this package archive (PPA).

Instructions are available there for how to manually add the PPA to your /etc/apt/sources.list file, but the following commands are sufficient on recent versions of Ubuntu:

sudo add-apt-repository ppa:pmiller-opensource/ppa
sudo apt-get update
sudo apt-get install contrast


Aegis Repo

The contrast project is developed using Aegis, a transaction based software configuration management system.

The Aegis repository for this project is available. The complete source is also available as a single Aegis change set.

The contrast package is written and owned by Peter Miller <pmiller@ opensource. org. au> and is freely distributable under the terms and conditions of the GNU GPL. There is more Software by Peter Miller at his home page.

This page has been accessed approximately times since 20-May-2012.