author: Krasimir Tsonev

Hi there, I'm . Senior front-end engineer with over 13 years of experience. I write, speak and occasionally code stuff. Follow me on Twitter, GitHub, Facebook or LinkedIn

Improve SVN logging

svn log - that\\'s something that I\\'m using every day. Before to release the application\\'s code in the production environment I always check the latest commits just to make sure that is safety to proceed. svn log is far from the perfect command for the purpose, but with several tweaks you can get the needed information.
Firstly, get the log information in a xml format:

  svn log -v --xml --with-all-revprops
  
Display only the latest ten commits (normally I don\\'t need the whole repository history shown):

  svn log -v --xml --with-all-revprops -l 10
  
Get only the message, the author and the date of the commit:

  svn log -v --xml --with-all-revprops -l 10 | egrep \\"(msg|author|date)\\"
  
At the end, remove the xml tags from the output:

  svn log -v --xml --with-all-revprops -l 10 | egrep \\"(msg|author|date)\\" | sed -e \\"s/([^<]*)/1/g\\" | sed -e \\"s/([^<]*)/1/g\\" | sed -e \\"s/([^<]*)/-------------------n1/g\\"
  
If you enjoy this post, share it on Twitter, Facebook or LinkedIn. Or maybe comment below: