I created the simplest of little bash functions that I use just about everyday. All it does is:
- Save the output of the SVN diff command of the current directory in a temp file.
- Open that temp file in TextMate, which does beautiful color coding of the diff for easy review before I check in.1
That’s it.
It’s very easy to set up. Edit your .profile file to add the following line:
diffit () { svn diff > ~/Desktop/temp.diff; open -a TextMate ~/Desktop/temp.diff; }
Now open a new terminal window, navigate to an SVN checkout directory that has local changes, and type ‘diffit’ – the command you just defined. You should see the SVN diff results in TextMate, and saved in a temp.diff file on your desktop.
- Now that I think about it, I need to take the time to get Araxis Merge set up to see how it handles .diff files. Also how well its SVN tools work. [back]
This post is part of the thread: Version Control – an ongoing story on this site. View the thread timeline for more context on this post.
You need the “mate” command installed for this, but if you don’t already have/use mate installed you should install it (Help / Terminal Usage).
It’s quite a bit simpler, and avoids the potential race condition! (I multitask!)
diffit () { svn diff |mate -a -; }
@Adam right on, my alias looks basically the same:
alias sdm="svn diff|mate"Also, just to tweak my ego, I’ve got one for running diffstat on my work:
alias sdstat="svn diff|diffstat"Hey! that command is really great and amazing. I too know little bit of programming but was confused.