Copyright © 2015-2019,2022 by Thomas E. Dickey

RCSHIST – comments and code


Here is a slightly cleaned up version of rcshist written by Ian Dowse.


Stray remarks

I happened to notice this program because I had written a different program by the same name (see comments in diffstat, as well as my discussion of old programs). As it turns out, there are programs with the same name which are unrelated, and related programs with different names. Here are a few notes on both:

This program

Ian Dowse's program does not seem to be well known. Here are the mentions which I have found:

My involvement

Because no suitable tool was available to study the history of rcs files, I wrote a script in 1998 which would extract all of the versions of a file. That done, I could use grep:

for name in $*
        REVS=`rlog $name |egrep '^revision' |sed -e 's/^revision//'`
        if test -n "$REVS" ; then
                for rev in $REVS ; do
                        pco -r$rev $name && mv $name $name-$rev
                pco $name

However, given a large number of revisions, there is a risk of running out of diskspace. I did not notice Ian's tool until sometime in 2007, as I first commented on it then:


Like the RCS "blame" tool, this is used for analyzing changes using the RCS history of a file. It differs from blame, however:

The changes are shown as a unified diff. Here is an example:

REV:1.346               aclocal.m4          2012/09/03 17:21:43       tom
tags:            xterm-281s, xterm-281r, xterm-281q, xterm-281p, xterm-281o,
                 xterm-281n, xterm-281m, xterm-281l, xterm-281k, xterm-281j,
                 xterm-281i, xterm-281h, xterm-281g, xterm-281f, xterm-281e
   change default for --with-xpm
--- aclocal.m4  2012/08/25 23:05:32     1.345
+++ aclocal.m4  2012/09/03 17:21:43     1.346
@@ -1,4 +1,4 @@
-dnl $XTermId: rcshist.html,v 1.16 2015/03/01 20:34:33 tom Exp $
+dnl $XTermId: rcshist.html,v 1.16 2015/03/01 20:34:33 tom Exp $
 dnl ---------------------------------------------------------------------------
@@ -3554,7 +3554,7 @@
 dnl ---------------------------------------------------------------------------
-dnl CF_WITH_XPM version: 1 updated: 2012/07/22 09:18:02
+dnl CF_WITH_XPM version: 2 updated: 2012/09/03 05:42:04
 dnl -----------
 dnl Test for Xpm library, update compiler/loader flags if it is wanted and
 dnl found.
@@ -3571,7 +3571,7 @@
 [  --with-xpm=DIR          use Xpm library for colored icon, may specify path],
-       [cf_Xpm_library=no])
+       [cf_Xpm_library=yes])
 if test "$cf_Xpm_library" != no ; then

Rcshist reads the RCS archive file into memory (which has reverse diff's) and reorders things so that it shows the changes as forward diff's.

Although the tool can work on multiple files, I use it on one at a time, reading the output into a buffer within vile. Even the largest of my RCS files takes less than a second. That is because it reads the file only once. Once in the editor, unlike blame, I can search for a given line and follow it back through whitespace changes rapidly.

There are some GUI tools (IDEs, and standalone tools such as ViewVC and gitk) which let you go back in a blame-style interface, but as a rule, going forward is awkward.


See the changelog for details: