threads / discuss / 2089

cg-prev and cg-next

Subject: cg-prev and cg-next

## tl;dr

One message between Oct 13, 2005 and Oct 13, 2005.

replies: 0people: 1as markdown or json

Zack Brown· Oct 13, 2005, 14:38 UTC · lore
Hi folks,

Sometimes I just want to surf through a project's history, getting a sense of where I was over time. So I wrote these short scripts to let me do that easily:

cg-prev:
    cg-seek `cg-log | grep "^commit " | head -n 2 | tail -n 1 | cut -d ' ' -f 2`
cg-next:
    CURRENT=`cg-log | grep "^commit " | head -n 1`       
    cg-seek > /dev/null
    cg-seek `cg-log | grep "^commit " | grep -B 1 "^$CURRENT" | head -n 1 | cut -d ' ' -f 2`
Even better, I guess would be to be able to do something like this:

$ cg-seek next $ cg-seek prev

and have it do the right thing.

Be well, Zack

-- 
Zack Brown

← back to recent threads