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

Unknown option: password #292

Open
lq2009 opened this issue Jul 9, 2020 · 6 comments
Open

Unknown option: password #292

lq2009 opened this issue Jul 9, 2020 · 6 comments

Comments

@lq2009
Copy link

lq2009 commented Jul 9, 2020

(⊙o⊙)?
[root@local]svn2git https://172.16.3.3/svn/ywzl --user='liqiang' --password '123456' --rootistrunk
Unknown option: password
command failed:
git svn init --prefix=svn/ --username='liqiang' --password='123456' --no-metadata --trunk='https://172.16.3.3/svn/ywzl'

@belgoros
Copy link

belgoros commented Aug 3, 2020

@Potato09 you don't need to use quotes, the right syntax is to separate the password value by space from --password option: --password YOUR_PASSWORD as it is indicated in README. The same is for any other available option. You can find more details in OptionParser API docs.

@axbusch
Copy link

axbusch commented Jun 8, 2021

No, space seperation does not work.

I have the same issue

@mcardia
Copy link

mcardia commented Jun 23, 2021

same error here. The password has symbols, if it helps.
And, if I type the password I got:

#<Thread:0x0000562f9d12e008 /var/lib/gems/2.7.0/gems/svn2git-2.4.0/lib/svn2git/migration.rb:431 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
        2: from /var/lib/gems/2.7.0/gems/svn2git-2.4.0/lib/svn2git/migration.rb:432:in `block (2 levels) in run_command'
        1: from /var/lib/gems/2.7.0/gems/svn2git-2.4.0/lib/svn2git/migration.rb:432:in `loop'
/var/lib/gems/2.7.0/gems/svn2git-2.4.0/lib/svn2git/migration.rb:438:in `block (3 levels) in run_command': undefined local variable or method `stdin' for #<Svn2Git::Migration:0x0000562f9d126b28> (NameError)
Did you mean?  String

My workarround was to change the file migrate.rb using "echo password |" instead of option password

        cmd = "echo #{password} |" + cmd unless password.nil?

        # Add each component to the command that was passed as an argument.
        cmd += "--username='#{username}' " unless username.nil?
        #cmd += "--password='#{password}' " unless password.nil?

@jesteves
Copy link

jesteves commented Dec 17, 2021

I've just made a PR to remove the support of --password and also to support password specification for git-svn via an environment variable. I followed the "echo-pipe" technique commented by @mcardia.

Such changes worked fine for me.

If anyone is interested, the PR is here and my fork, here.

@ghost
Copy link

ghost commented Mar 17, 2022

--password doesn't work anymore, you have to manually input the password or use the workaround to set an env var.

I actually had even more issues and svn2git didn't work for me at all.

I managed to migrate using the steps outlined here
https://gist.github.com/leftclickben/322b7a3042cbe97ed2af

@ibaoger
Copy link

ibaoger commented Jun 7, 2022

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.

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

6 participants