SubEthaEdit and Subversion part II

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  | Tags , ,  | 9 comments

Comments

  1. Elliott Hughes said about 1 hour later:
    I always knew we were doing a poor job of advertising SCM (a GPL front-end to various revision control systems)! You've prompted me to write Why you should use jessies.org SCM tools.
  2. map said about 2 hours later:
    Eliott, some of us live in bash and like it. I don't see why you feel those people are "masochists". I looks to me like you haven't even tried the things mentioned here, due to your "doing commits via your editor's find/replace functionality" comment. In fact SubEthaEdit diff.mode display of a diff looks quite similar to RevisionTool's diff display...
  3. Bob said about 22 hours later:
    The processes described here sounds pretty painful. Why pretend there is a interface between SubEthaEdit and svn when it consists of a bunch of arcane commands and shell scripts. Assuming I am incorrect in my evaluation---and I probably am---please help me out with my lack of understanding here. BTW, I use TeX, Plain TeX that is, and have read the The TeXBook several time, so it's not like I can not understand arcane content. :) Thanks.
  4. map said about 23 hours later:

    Bob, the tips described here are ment for an audience that interacts with subversion via "arcane commands" anyway.

    If you prefer using a GUI to interact with your SCM, Xcode and svnX come to mind as frontends.

  5. dom said about 23 hours later:
    as map said: the see tool and this tips are for people that like living in the command line. I myself e.g. am normally a total gui person. But when it comes to subversion there just isn't a real good subversion gui client IMHO so I put up with the command line.
  6. neck pain said over 4 years later:

    Thanks to all the members who have given their wonderful comments.... keep on posting

  7. Andrew Garcia said over 4 years later:

    I am glad i found this coding treasure. it is filled up with lots of tips and tricks. Keep up the great work.

  8. rosalin jones said over 4 years later:

    Nice information. But can you explain how to use bash mode with subEthaEdit. I am getting much of the trouble while trying out this? rosalinjones

  9. kim miller said over 4 years later:

    this feature not only reduces the time but also cut down the problems relating to mixed line ending.

(leave url/email »)

   Comment Markup Help Preview comment