Tech Blog :: Shell shortcut for SVN URL


Nov 10 '09 4:33pm
Tags

Shell shortcut for SVN URL

This took me some time to figure out. It's a shell command to extract the URL from an svn info command. Run this (or put it in .bash_profile):

alias svnurl="svn info | egrep '^URL: (.*)' | sed s/URL\:\ //"

Then you can do things like svn ls $(svnurl) or svn log $(svnurl) to run commands on the remote repository. I expect this'll save me a bunch of time in the future.

And this is another one I've used for a while, to view changes in a working copy, especially useful when there are externals that output text even when there are no changes:

alias svnnew='svn st | grep -e "^[!M?~ACDR ]"'

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote>
  • Lines and paragraphs break automatically.
  • Identifies Twitpic URLs, downloads their images, displays image instead of URL.

More information about formatting options