I'm not familiar with the git-svn, but this logic seems a bit crazy with a lot of special cases and the string manipulation piped out to `/bin/sh`. Maybe could be moved out to a separate function to isolate?