bstpierre.org

Projects

cvs quickies

July 05, 2001

Here are a couple of little conveniences for working with cvs:

# This displays the last change 
# comment for the named files.
function lastcomment()
{
	cvs log -rHEAD $*
}

# This displays diffs between the most
# recent version and the prior version.
function lastchange()
{
	basev=`lastcomment $1 |\
                   grep ^head: |\
                   cut -d'.' -f 2`
	priorv=`expr $basever - 1`

	cvs diff -r1.$priorv -r1.$basev $1
}

To use them, copy the above into your ~/.bashrc and re-source ~/.bashrc (by doing . ~/.bashrc at the bash prompt).

Note that neither of these will work as-is if you are working on a branch.