nirvdrum / svn2git

Ruby tool for importing existing svn projects into git.
MIT License
2.11k stars 443 forks source link

keyboard input for password entry when running svn2git does not work when accessing remote svn repo #242

Open louisechan opened 7 years ago

louisechan commented 7 years ago

For this bug to occur, make sure to delete any cached svn authentication info for the remote svn repository being accessed in your PC. For my linux machine, cached authentication is usually stored as an alpha-num file within the ~/.subversion/auth/svn.simple directory.

I have observed this to happen on both Windows 7 and Ubuntu Linux so this might possibly be related to the stdin capture code while running the git-svn command within the script. In Windows, only the ENTER key is recognized while on Linux, keyboard input is not recognized at all during password prompt and I have to cancel the svn2git script using ctrl-C.

A workaround for this bug would be to run a dummy git-svn command in terminal such as:

git svn init --username='myusername' --tags='tags' https://remote_svn_repo_url

so that I can input my svn repo password and have the authentication info cached in ~/.subversion/auth/svn.simple.

Once the svn authentication info has been cached, running:

svn2git https://remote_svn_repo_url --username myusername

will now work.

dmsmidt commented 7 years ago

I've encountered this issue on macOS as well.

dmsmidt commented 7 years ago

Another nice workaround here: https://github.com/nirvdrum/svn2git/issues/174#issuecomment-58649456

I also found that just pressing enter once, then entering the password and pressing enter again also works on macOS Sierra.

brntbeer commented 7 years ago

Bump, also a problem for me. In fact, im not sure if it's svn2git's fault or not. When i see the command that's failing, i also notice the command it's running git svn init and manually typing the command out still fails:

[/scratch/subversion]$ git svn init --prefix=svn/ --username='USERNAME' --password='PASSWORD'  
--no-metadata --trunk=trunk --tags='tags' --branches='branches' https://HOSTNAME/svn/SampleProject
Unknown option: password
dilshankm commented 4 years ago

I'm facing the same issue. Any updates on this?

ibaoger commented 2 years ago
gem uninstall svn2git
gem install svn2git3
SVN2GIT_PASSWORD=<<password>> svn2git http://svn.example.com/path/to/repo --username <<user_with_perms>>

this issue has resolved by @jesteves, I pushed it to rubygems.