-
-
Save gogomako/94213ea73f9bf64f127273bf4ee17c33 to your computer and use it in GitHub Desktop.
Converts git diff to svn patch format and acceptable for reviewboard 2.0.23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TAB=$'\t' | |
| #get svn revision from manually input | |
| SVN_DIFF_REV=$1 | |
| git diff --no-prefix --ignore-space-at-eol | sed -e "s/^diff --git [^[:space:]]*/Index:/" -e "s/^index.*/===================================================================/" -e "/^---/s/$/${TAB}(revision ${SVN_DIFF_REV})/" | awk '{if($1!="+++") print ; else print $1" "$2"\t(working copy)"}' | sed -e "/\/dev\/null/s/[0-9]*)$/0)/" > changes.patch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment