Auto-Edit SVN Conflicts

Ovid on 2008-04-21T14:06:53

From time to time, we get conflicts when we merge SVN branches. Now I can automatically edit them:

alias edit_conflicts="${EDITOR:-vim} \$(svn status|grep '^C'|awk '{print \$2}')"

That uses whatever is in your EDITOR environment variable, but defaults to vim.


awk

Dom2 on 2008-04-26T07:39:18

Usually, you can replace any grep | awk with just awk. In the instance above, you could say awk '/^C/{print $2}'.

Re:awk

Ovid on 2008-04-28T09:32:24

Thanks. Works like a charm. I now have the following:

alias edit_conflicts="${EDITOR:-vim} \$(svn status|awk '/^C/{print \$2}')"
alias edit_code="${EDITOR:-vim} \$(svn st | awk '/^[AM].*p[ml]/{print \$2}')"
alias edit_tests="${EDITOR:-vim} \$(svn st | awk '/^[AM].*\.t$/{print \$2}')"