Home » Software I've written » scdiff

What is scdiff?

Imagine this: you've just made changes to code kept in CVS, Subversion or Git repository. You're ready to check them in but you want to take a last look at the changes. Usually you would do cvs diff -u or svn diff. This program allows you to see the changes with an external gui diff program. I find it much easier to understand the changes that way (as opposed to looking at unified diff in the console). By default it uses windiff.exe but you can use -diff option to select any other program (e.g. WinMerge or Araxis Merge) . Clearly, it's a tool for developers.

Usage

scdiff [-h] [-old] [-cvs cvsCommand] [-cvsargs cvsOptions] [-diff diffProgramPath]

If you run scdiff without any arguments, it'll determine if a given directory is under CVS or Subversion control, check for locally modified files and launch external diff program showing local modifications. By default it uses windiff (assumes that windiff.exe is in the %PATH%) but you can use -diff option to use any other diff program that can be launched from command lind. First two arguments given to the diff program are directories to diff. This works for all diff programs I've tested it (windiff, WinMerge and Araxis Merge).

By its nature (see how it works for more explanation) scdiff uses temporary directory for storing original and modified files so even after you finish, you can still see the result of previous diff. Option -old does exactly that. It saves the time (getting files from repository may take some time).

To see built-in help, use -h option.

Option -cvs defaults to "cvs -z3". Option -cvsargs defaults to "-u -N". In theory you shouldn't need to change them.

Download

Download scdiff.exe. Requires .NET Framework 2.0.

Source code

You can get the sources from project site.

Version history

0.5 (2009-03-11):

0.4 (2004-12-08):

0.3 (2004-10-02):

0.2 (2004-06-08):

0.1 (2004-06-03):

How it works

Not that it's terribly interesting, but just in case you were wondering. First, we capture the output of cvs diff -u or svn diff. From that we extract names of the files that are locally modified and the revision number of the file before modifications. The we check out the originals (using cvs update -p -r rev or svn cat ...), copy the originals to $tempDir/sc_originals, our locally modified copies to $tempDir/sc_altered and launch external diff program with $tempDir/sc_originals and $tempDir/sc_altered as arguments. Pretty simple and possibly suboptimal (subversion can do a diff without contacting remote repository, so it should be possible to significantly speed up the program if I knew how to get the original without asking remote repository).

Todo

It's really a quick & dirty program, so there's potential for a lot of stuff to be done. In the "blue sky" departement, I would like to have a full-fledged program for browsing changes in CVS or Subversion repositories. And no, it's not about re-writing WinCVS and the like for the fun of it. WinCVS does much more that what I need my ideal program to do, but it also doesn't do what I want (easily end efficiently browse changes).

But that's unlikely to happen, so here's a couple of things that could be fixed:

Links

Feedback

As noted, this program is simple, does one thing that is useful to me. It might never get any better and there's not much to talk about. If you, however, have a burning desire to talk to me about it (you know, comments, bug reports, suggestions etc.), you can always send me an e-mail.