shallow.c: implement a generic shallow boundary finder based on rev-list