/ authors.txt

Migrating to git - part 01 - svn authors file

Today we’re talking about subversion. About how to accomplish a migration from subversion to git. Before doing such an import, some preparation is needed. Git needs to know which authors are relevant for your import and how to relate the git checkins to these authors on import.

One thing to prepare is a authors.txt file containing all authors that have checked in version in your subversion repository. This file should look like this:

rob = Rob Dude <dude@example.com>
someguy = Some Guy <someone@example.com>

To archive this layout automagically, just do a subversion log task and parse the required names:

authors=$(svn log -q | grep -e '^r' | awk 'BEGIN { FS = "|" } ; { print $2 }' | sort | uniq)
for author in ${authors}; do
  echo "${author} = ${author} <${author}@LOCALHOST.NET>" >> authors.txt;

After executing this handy script on your console the file is created based on your subversion checkin history. Optional you need to edit the file to use the correct emails (@LOCALHOST.NET).