nirvdrum / svn2git

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

Entering BASIC auth password doesn't work #174

Open ghost opened 10 years ago

ghost commented 10 years ago

Executing svn2git -v --username "mylogin@blah.com" http://10.68.8.14/svn/repo/

leads to git-svn asking for password:

Running command: git svn init --prefix=svn/ --username=mylogin@blah.com --no-metadata --trunk=trunk --tags=tags --branches=branches http://10.68.8.14/svn/repo/
Initialized empty Git repository in /home/yura/p/repo/.git/
Authentication realm: <http://10.68.8.14:80> repo-svn
Password for 'mylogin@blah.com':

at which stage entering any text does nothing. Enter key does nothing. The only thing I can do is press Ctrl+C:

 /var/lib/gems/1.9.1/gems/svn2git-2.3.2/lib/svn2git/migration.rb:421:in `join': Interrupt
        from /var/lib/gems/1.9.1/gems/svn2git-2.3.2/lib/svn2git/migration.rb:421:in `each'
        from /var/lib/gems/1.9.1/gems/svn2git-2.3.2/lib/svn2git/migration.rb:421:in `block in run_command'
        from /var/lib/gems/1.9.1/gems/svn2git-2.3.2/lib/svn2git/migration.rb:388:in `popen'
        from /var/lib/gems/1.9.1/gems/svn2git-2.3.2/lib/svn2git/migration.rb:388:in `run_command'
        from /var/lib/gems/1.9.1/gems/svn2git-2.3.2/lib/svn2git/migration.rb:202:in `clone!'
        from /var/lib/gems/1.9.1/gems/svn2git-2.3.2/lib/svn2git/migration.rb:34:in `run!'
        from /var/lib/gems/1.9.1/gems/svn2git-2.3.2/bin/svn2git:27:in `<top (required)>'
        from /usr/local/bin/svn2git:23:in `load'
        from /usr/local/bin/svn2git:23:in `<main>'

When I execute the git svn command stand-alone, its password prompts works all right.

Giving the password as stdin to the svn2git process doesn't work either, but in another way: git-svn just asks for a password three times in a row and then quits with the auth failed message.

svn2git 2.3.2, ruby 1.9.3, Debian.

ghost commented 10 years ago

Workaround:

install nginx and configure it as a proxy that adds Basic auth header automatically:

upstream backend  {
        server 10.68.8.14;
}

server {
        listen   8888; ## listen for ipv4; this line is default and implied

        proxy_set_header Authorization "<INSERT VALUE HERE FROM CHROME INSPECTOR>";

        location / {
                proxy_pass http://backend;
        }
}

And then just use svn2git http://127.0.0.1:8888/svn/repo.

aliceinwire commented 10 years ago

same problem here i could resolve by ctrl+z and fg after that i could insert the password two time and pressing enter key and is now working. for sure not the best fix but i didn't want to install nginx :/

asfdfdfd commented 7 years ago

This bug is still here.

aliceinwire's workaround works.

vietvudanh commented 7 years ago

Confirm the bug still around, MacOS 10.12.5