Git SVN diff compatible with reviewboard (and TortoiseSVN?)

Recently I needed to upload some patches to Review Board. I foolishly tried to upload a patch that was created by git diff (I’m a git-svn user) but Review Board expects an SVN patch… While there are some simple solutions to be found on the web, I could not find any that correctly handled new files in the patch. The closest thing I found was a mail on the KDE panel-devel mailinglist.

I started looking into sed and came up with a slightly more powerful version:

This script supports updated files and new files. I have not tested it yet with deleted files.

Feel free to use it if you need it. Good luck!

Note: a friend linked me a Perl script that does the same thing. I haven’t tested it yet, so I have no idea how well it works.