Skip to content

Instantly share code, notes, and snippets.

@prjemian
Last active January 3, 2017 18:56
Show Gist options
  • Select an option

  • Save prjemian/53b2112d31bb79a8eb2665006310995d to your computer and use it in GitHub Desktop.

Select an option

Save prjemian/53b2112d31bb79a8eb2665006310995d to your computer and use it in GitHub Desktop.
create `users.txt` for migrating SVN to GIT

Create a file mapping all SVN comitters to "name " for Git{Hub,Lab}.

Assuming the SVN repository fits this form:

  • $URL : repository URL, such as http://svn.svnserver.net/repo
  • $REPO : repository directory, such as sizes
# mkdir ~/sandbox
# cd ~/sandbox
svn co $URL/$REPO
svn log ./$REPO -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > users.txt
/bin/rm -rf ./$REPO
echo "Edit the entries in file: users.txt
echo "Each line should fit this format: username = full name <email>"
# example: jemian = Pete Jemian <prjemian@gmail.com>

or skip the checkout and inspect the logs direct from the server:

svn log $URL/$REPO -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > users-$REPO.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment