Sunday, October 7, 2007

Handy Alias: Grab latest svn log

I keep having the occasion to view the log comments for the current revision in my SVN repository. This means:
  • Knowing the number of the current revision,
  • Passing this to svn log -r
Instead of doing that by hand, I made an alias to do it for me:
alias svnlastlog="svn info | grep 'Last Changed Rev' | cut -d ' ' -f 4 | xargs -I mystr svn log -r mystr"
So if you are in a directory that is versioned, you just run that command, and (after being prompted to authenticate to your repo, if applicable), out comes the log entry for the current revision. Perhaps there is a built in command to do this already, but I could not find it via Google and the SVN Book.

1 Comments:

Anonymous Glen said...

Nice and thank you for sharing the snippet.

April 6, 2008 at 12:04 AM  

Post a Comment

Subscribe to Post Comments [Atom]

<< Home