Posted by dom
Tue, 02 May 2006 15:33:00 GMT
Continuing with the more advanced stuff: Adding many files via the svn add command can be a tedious effort. Especially if they are dispersed over many directories. But here the see command line tool can help. Instead of svn add do
svn st | see | sh
What this does is simple, it does a
svn st and pipes it to the nearest
SubEthaEdit for editing. So far so good. The next steps are easy:
- trim all the lines which you don’t want to add
- select all and do a blockedit to replace the first few characters with a svn add
- then close the window
the closing of the window hands this little snippet over to sh which does a decent job of executing every single svn add line you just left in your text. Much more convenient than adding the files one by one.
Too add even more convenience, I added the following alias to my ~/.bash_profile file. Now I have a convenient little command called svnadd that does a svn st, greps for all lines that begin with a ? (which are the files that may need adding), shows them to me via SubEthaEdit in which I can pick my lines and add the svn add, and sends them to sh when I’m done. Very handy.
alias svnadd="svn st | grep '^\?' | sed -e 's/\?[ ]*/svn add /g' | see -r -t \"svn st\" -j \"->to sh\" | sh"
More recently bbum has brought up a really nice way of doing shell aliases to quickly use the output of the svn st command to look into the details of the status. I myself find the M shortcut for quick diffing most useful, and therefore I added these lines to my ~/.bash_profile:
function M() {
svn diff $* | see -m diff -t "diff:$*"
}
Which really gives nice quick access to a see enhanced diff.
Posted in SubEthaEdit | Tags see-tool, subethaedit, subversion | 9 comments
Posted by dom
Fri, 31 Mar 2006 10:38:00 GMT
First the basics. If you like SubEthaEdit and live in the command line some time in your computer life, you'd be happy to know that we ship a command line utility with SubEthaEdit that allows you to use SubEthaEdit as your command line editor.
The tool is called see and you can install it via the Advanced preference pane. The Install button will install the tool at /usr/bin/see - so it's ready to use directly in your standard command line path. To get detailed information about its usage, just type man see anytime after installation. (This HTML rendering of the man page was created using Bwana - a really nice tool that lets you type e.g. man:see in your browser and displays the man page.)
There are a ton of nice features in the see command, the one I like most is the fact that you can pipe in and especially out of it - so you can integrate it in any unix workflow you are using. I will show a example of this in a follow up post to this.
If you are a Subversion user, you'd probably want to tell Subversion to use SubEthaEdit when editing. To have that you edit your ~/.subversion/config file and change your editor-cmd of the [helpers] section to this:
[helpers]
editor-cmd = see -w -r -j "SVN"
Now you get a nice temporary SubEthaEdit window when you do a checkin or a propedit,
-w tells the see tool to wait for the window to be closed before continuing,
-r makes the see tool switch back to the terminal after the job is done and
-j adds a nice little SVN to the window title.
That's it for now, share and enjoy!
Posted in SubEthaEdit | Tags see-tool, subethaedit, subversion | 8 comments