tadhg.com
tadhg.com
 

Short Subversion/Unix CLI Trick

17:19 Thu 10 Apr 2008. Updated: 23:27 15 Apr 2008
[, ]

I use Subversion a lot both at work and at home, and for a while have wanted a way to make it easier to see which files get marked as merged or conflicted in an update.

It turns out that this is pretty easy, because the tee command lets you “split” content to standard output and some file. I had never heard of that command until last year, and promptly forgot about it again until a co-worker reminded me about it.

So, the alias below is what I use instead of svn up now. (I use tcsh, but I think it should work in most shells.) It performs the svn up command as usual, writing output to the screen (because I still want to see the overall output) and also writing that output to a file in my homedir. That file is then read and passed through grep to display the lines starting with G or C, so that merged and conflicted files are easy to see.

sup    svn up | tee ~/last_svn.txt; more ~/last_svn.txt | grep '^[CG]'
« (previous)

Leave a Reply