| 1 | = Introduction = |
| 2 | |
| 3 | This page contains developer documentation that is useful, but rarely needed. |
| 4 | |
| 5 | = Converting SVN revisions to Git patches = |
| 6 | |
| 7 | There's a Python script available that converts SVN revisions into patches ''git am'' can understand: |
| 8 | |
| 9 | * http://blog.repl.ca/2009/06/converting-svn-commits-to-git-patches.html |
| 10 | |
| 11 | To use this script, copy it into the SVN repository root as ''svnrev2git.py''. Then create an authors file using this format: |
| 12 | |
| 13 | {{{ |
| 14 | svnusername, firstname lastname, email |
| 15 | }}} |
| 16 | |
| 17 | For example: |
| 18 | |
| 19 | {{{ |
| 20 | johndoe, John Doe, john.doe@domain.com |
| 21 | }}} |
| 22 | To use the script, call it like this: |
| 23 | |
| 24 | {{{ |
| 25 | $ python svnrev2git.py authors <revision> |
| 26 | $ python svnrev2git.py authors <revision_start>-<revision_end> |
| 27 | }}} |
| 28 | |
| 29 | For example: |
| 30 | |
| 31 | {{{ |
| 32 | $ python svnrev2git.py authors 8126 |
| 33 | $ python svnrev2git.py authors 8126-8225 |
| 34 | $ for REV in 8206 8212 8219 8225; do python svnrev2git.py authors $REV;done |
| 35 | }}} |
| 36 | |
| 37 | Note that the script is slow in processing long revision ranges: it's usually a better idea to pick the required revisions by hand. |
| 38 | |
| 39 | = Poor-man's Symdiff = |
| 40 | |
| 41 | Andj came up with a clever script in [http://thread.gmane.org/gmane.network.openvpn.devel/4869 an IRC meeting] to generate diffs that make reviewing refactoring patches easier: |
| 42 | |
| 43 | {{{ |
| 44 | #!/bin/bash |
| 45 | git diff $1 $2 >/tmp/difftmp123.txt |
| 46 | cat /tmp/difftmp123.txt |grep "^-" |sed s/^-// >/tmp/removed123.txt |
| 47 | cat /tmp/difftmp123.txt |grep "^+" |sed s/^+// >/tmp/added123.txt |
| 48 | diff /tmp/removed123.txt /tmp/added123.txt -u |
| 49 | }}} |
| 50 | |
| 51 | This is similar to [http://research.microsoft.com/en-us/projects/symdiff Symdiff]. |