wiki:DeveloperTips

Version 1 (modified by Samuli Seppänen, 7 years ago) (diff)

Migrate content from DeveloperDocumentation page

Introduction

This page contains developer documentation that is useful, but rarely needed.

Converting SVN revisions to Git patches

There's a Python script available that converts SVN revisions into patches git am can understand:

To use this script, copy it into the SVN repository root as svnrev2git.py. Then create an authors file using this format:

svnusername, firstname lastname, email

For example:

johndoe, John Doe, john.doe@domain.com

To use the script, call it like this:

$ python svnrev2git.py authors <revision>
$ python svnrev2git.py authors <revision_start>-<revision_end>

For example:

$ python svnrev2git.py authors 8126
$ python svnrev2git.py authors 8126-8225
$ for REV in 8206 8212 8219 8225; do python svnrev2git.py authors $REV;done

Note that the script is slow in processing long revision ranges: it's usually a better idea to pick the required revisions by hand.

Poor-man's Symdiff

Andj came up with a clever script in an IRC meeting to generate diffs that make reviewing refactoring patches easier:

#!/bin/bash
git diff $1 $2 >/tmp/difftmp123.txt
cat /tmp/difftmp123.txt |grep "^-" |sed s/^-// >/tmp/removed123.txt
cat /tmp/difftmp123.txt |grep "^+" |sed s/^+// >/tmp/added123.txt
diff /tmp/removed123.txt /tmp/added123.txt -u

This is similar to Symdiff.