How Do I Show Changes to a Single File for a Single Commit? Edit

CVS Edit

Unlike the previous recipe, this is something that CVS is perfectly capable of. If the revision you're interested in is a trunk revision, say 1.10, then you just need to compare it with its predecessor:

 cvs diff -r 1.9 -r 1.10 <filename>

If the revision in question is along a branch (1.x.y.z), finding its predecessor is a smidge more difficult. In particular, if it's the first revision on the branch (1.x.y.1), then you need to chop off the last two components of the revision number to get the trunk revision which preceded it:

 cvs diff -r 1.9 -r <filename>

darcs Edit

git Edit

This is the same as the previous recipe, just adding the filename to the command line:

 git-diff <nnnn>~1 <nnnn> <filename>

Of course, since commits span the whole tree, you can list multiple files and/or directories.

Mercurial Edit

Subversion Edit

As with git, you just add the filename to the command line from the previous recipe:

 svn diff -r <prev>:<rev> <filename>

And likewise, you can list multiple files and/or directories