Version Control: Link
|Submitted: Dec 11 2011|
Updated: Sep 26 2012
'crescow' is a primitive wrapper script around the original svn cli command.
It adds some functions to the command, also offers something between cli and gui.
We all know about the advantages of a cli command. It is crunchy, it is precise. It does what you want it to do. Fast, without hassles, and it can be integrated in a workflow when you use it in a unix like environment. So I myself use cli commands a lot, although there might be gui versions available.
However, we also do know that cli commands do have limitations. Let me give a simple example:
Say I develop an application and use svn for source revision control. Using the original svn cli command I can visualize the local changes a file has received:
#> svn diff app/src/folder/my_class.cpp
Works like charm. But if there are several non-trivial changes the output gets a little hard to read. In those cases I find myself in something like a gap between cli and gui. Argh, I have to fire a full svn gui frontend just to call a single command in the end ! Can't be ! There must be something more direct ! There is: 'crescow' !
#> svn kdiff3 app/src/folder/my_class.cpp
This simple line fires a full fledged graphical file difference comparing tool (kdiff3 in this case) on a file specified. The good thing: the syntax of the call is that of the original svn cli command. So in a way it appears as if the svn command has been extended by additional sub commands. Additional to the collection available built-in and well documented. The extensions are not limited in any way, it is possible to add further cli based commands to it.
Take the script as a starting point and add those commands you miss in the original version.
!! And don't forget to share your action definitions here for others !!
Currently (version 0.1.1) this script extends the svn command by these three actions:
1.) svn strip foo/bar
strips the hidden ".svn" folder from foo/bar. Saves you from having to do an additional export from the repository. Do a copy plus "svn strip" instead.
2.) svn kompare foo/bar.cpp or svn kdiff3 foo/bar.cpp
fires a graphical diff viewer (kompare or kdiff3) for a more convenient visualization of file changes
3.) svn grep -rni foo bar
greps for "foo" in folder bar, but ignores matches in the hidden ".svn" folders
Store the script somewhere in your path (~/bin/crescow) and make it executable (chmod a+x ~/bin/crescow). It is a bash script, so you must have bash installed (/bin/bash). You could call the script directly, but it makes more sense to define an additional alias (in ~/.alias): alias svn=\"~/bin/crescow \". Note the trailing blank inside the alias definition, this is required (see: man alias). After loading the alias (new shell) you can now use the svn command as usual, but it has additional features !
* svn cli command
The script is trivial. It is primitive. Don't blame me for that.
It always came in handy, day after day. Sometimes simple things are the best. So I share it.
You can simply add further actions by using a text editor. Just add further case branches to get whatever function you desire.
And don't forget to publish your extension in a comment to share with others !
Please note that this script does not support newer svn version from 1.7 upwards. This is due to changes of the internal storage structure inside the svn meta data container. The new structure is much more complex to work with. Most likely this script won't be ported to support newer svn versions. Sorry for that.