Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How I got it to work on Mac 8/2020 - Cloudforge (svn) #295

Open
jgusta opened this issue Sep 4, 2020 · 1 comment
Open

How I got it to work on Mac 8/2020 - Cloudforge (svn) #295

jgusta opened this issue Sep 4, 2020 · 1 comment

Comments

@jgusta
Copy link

jgusta commented Sep 4, 2020

Getting svn2git to work on Mac 8/2020

Hello my fellow SVN refugees. We are bailing from Cloudforge as they are shutting down their SVN services. Here's how I got svn2git to work on my Mac locally. (Mojave 10.14.6). This should help with (#292) and (#283)

  • We're lucky to have a standard svn layout. I'm afraid I can't help with non-standard.
  • Using bash and iterm2.
  • Make sure your password doesn't have any dollar signs or other special bash characters like a space or backslash. If you have a dollar sign in your password you are going to have a bad time. I don't know how to get around it, its easier to just change your password.
  • I used rvm to install ruby 2.4.0
    rvm install "ruby-2.4.0"
    rvm use 2.4.0 --create
    gem install svn2git
  • start from inside a blank folder
  • My final command looked something like this. The --authors parameter is optional, but probably desired. See "Extra: generate an authors file" below for how to do this.
svn2git https://svn.example.com/path/to/repo --username myusername --authors ../your_authors_file.txt
  • Here's the weird part. When prompted for password I had to paste my password in, hit enter, paste again then hit enter. Then the prompt comes up AGAIN and I have to repeat: paste password, hit enter, paste password hit enter. Then it started working. Not sure which part of that is actually correct but it worked.

After conversion

And for the sake of completion here are some other details.

  • If all goes well, and you did run the command in an EMPTY folder, you should have nothing uncommitted remaining in your folder.

  • You will need an empty repository on your new git host.

  • It is traditional and/or mandatory for some hosted git services to have a README.md so create that and commit.

  • Final steps after conversion:

    • add your new git origin from the local folder
      git remote add origin xxxx@xxxx.com:<project>.git
    • push all branches of your newly converted git repo
      git push --all origin
    • push all tags tags
      git push --tags origin

Extra: generate an authors file

source https://docs.gitlab.com/ee/user/project/import/svn.html#cut-over-migration-with-svn2git

  • The authors file maps your svn usernames to a git username and email. Otherwise the old commits wont match to the usernames. This is probably a big deal.
  • You would do this BEFORE running svn2git
  • You will need a checked out copy of the svn repo to generate the authors file, even though you will need an empty folder to do the svn2git conversion (AFAIK).
  • Go into the svn folder locally, run:
svn log --quiet | grep -E "r[0-9]+ \| .+ \|" | cut -d'|' -f2 | sed 's/ //g' | sort | uniq

It will output a list of usernames. It will take a while. Take the output and construct an authors.txt file in this format:

janedoe = Jane Doe <janedoe@example.com>
johndoe = John Doe <johndoe@example.com>

Map ALL the users that come out or it will fail. Use this file in the --authors parameter.

@abeger
Copy link

abeger commented Feb 4, 2021

Here's the weird part. When prompted for password I had to paste my password in, hit enter, paste again then hit enter. Then the prompt comes up AGAIN and I have to repeat: paste password, hit enter, paste password hit enter. Then it started working. Not sure which part of that is actually correct but it worked.

This is what I needed to get it working. I didn't have to paste, but I did have to enter my password twice at the prompt. Never would've thought to do it without this.

THANK YOU.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants