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:

1
2
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.

Post to Twitter Post to Delicious Post to Digg Post to Reddit

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

This entry was posted in CLI and tagged , , . Bookmark the permalink.

3 Responses to Handy Alias: Grab latest svn log

  1. Glen says:

    Nice and thank you for sharing the snippet.

  2. Eric says:

    svn status -v

    output:
    working copy revision|current revision|last changed owner|filename

  3. @Eric Thanks, that’s definitely handy to see all the revisions per file and dir at a glance. Not sure why you might care about that exactly in the context of log information though, I myself only really want the log information for the current rev, no matter what it is.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>