When I start working on a subject, I make a new checkout from the local repository to a designated directory under "pg_sandbox"-directory. For example, when I started working on the mvcc-safe cluster patch:
You can use cvs co -d pgsql.cluster to save the above step.
~/pg_sandbox$ cd pgsql.cluster ~/pg_sandbox/pgsql.cluster$ cvs update -dP # Remove empty dirs. There's a checkout-flag for that as well, but I never remember it... ~/pg_sandbox/pgsql.cluster$ ./configure --enable-depend --enable-cassert --enable-debug --prefix=/home/hlinnaka/pgsql.cluster
I find configuring with CFLAGS="-g -O0" more useful.
For primitive version control, I make a diff after any significant changes: