Skip to content

Latest commit

 

History

History
99 lines (85 loc) · 4.51 KB

ReadMe.md

File metadata and controls

99 lines (85 loc) · 4.51 KB

Ruby SVN2Git Docker

GNU General Public License Total Releases Downloaded from GitHub Latest Official Release on GitHub ICONOMI - The world’s largest crypto strategy provider Buy me a Coffee as a way to sponsor this project!

Simple Dockerfile to run the Ruby Nirvdrum/SVN2Git script under a Docker container!

Reasoning

Dependencies

Installation

  1. Download the latest Dockerfile from the Ruby-SVN2Git-Docker releases
wget "$(
    curl -s -H "Accept: application/vnd.github.v3+json" \
    'https://api.github.com/repos/Rikj000/Ruby-SVN2Git-Docker/releases/latest' \
    | jq .assets[0].browser_download_url | sed -e 's/^"//' -e 's/"$//')";
  1. Build svn2git container
docker build . -t svn2git:v2.4.0;

Usage

  1. Check out the SVN repository at the latest revision
svn checkout \
    "file:///path/to/svn/input/repo/@HEAD" \
    "/path/to/svn/output/checkout/";
  1. Query SVN checkout version history for 'authors-file.txt'
cd "/path/to/svn/output/checkout/";
svn log -q | \
    awk -F '|' '/^r/ {gsub(/ /, "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | \
    sort -u > "/path/to/authors-file.txt";
  1. Run svn2git container example
mkdir "/path/to/git/output/repo/";
docker run \
--volume "/path/to/git/output/repo:/var/svn2git" \
--volume "/path/to/svn/input/repo:/var/svn" \
--volume "/path/to/authors-file.txt:/var/authors-file.txt" \
    svn2git:v2.4.0 \
    "file:///var/svn" \
    --trunk "trunk_dir" \
    --branches "branches_dir" \
    --tags "tags_dir" \
    --authors "/var/authors-file.txt";

Note --rootistrunk is broken, instead use --trunk "/" --nobranches --notags
See: nirvdrum/svn2git#127

Note --exclude is broken

  1. Push all branches + tags to Forgejo (or another Git forge like Github/Gitlab)
cd "/path/to/git/output/repo/";
git remote add origin http://localhost:3000/username/projectname;
git push origin '*:*';