{"thread":{"id":"45191","subject":"[PATCH] git svn branch fails with authenticaton failures","startedAt":"2017-02-22T02:45:23Z","lastAt":"2017-02-23T20:54:57Z","messageCount":2,"participants":["Hiroshi Shirosaki","Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"312271","messageId":"1487731055-29153-1-git-send-email-h.shirosaki@gmail.com","threadId":"45191","inReplyTo":null,"subject":"[PATCH] git svn branch fails with authenticaton failures","fromName":"Hiroshi Shirosaki","fromEmail":"h.shirosaki@gmail.com","sentAt":"2017-02-22T02:37:35Z","receivedAt":"2017-02-22T02:45:23Z","isPatch":true,"sender":{"key":"h.shirosaki@gmail.com","avatar":null},"body":"I have the following authentication failure while svn rebase and\nsvn dcommit works fine without authentication failures.\n\n$ git svn branch v7_3\nCopying https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx at r27519\nto https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/v7_3...\nCan't create session: Unable to connect to a repository at URL\n'https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx': No more\ncredentials or we tried too many times.\nAuthentication failed at\nC:\\Program Files\\Git\\mingw64/libexec/git-core\\git-svn line 1200.\n\nI can workaround the issue to add auth configuration to\nSVN::Client->new().\n---\n git-svn.perl | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex fa42364..13fa4ad 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -1175,10 +1175,10 @@ sub cmd_branch {\n \t::_req_svn();\n \trequire SVN::Client;\n \n+\tmy ($config, $baton, $callbacks) = Git::SVN::Ra::prepare_config_once();\n \tmy $ctx = SVN::Client->new(\n-\t\tconfig => SVN::Core::config_get_config(\n-\t\t\t$Git::SVN::Ra::config_dir\n-\t\t),\n+\t\tauth => $baton,\n+\t\tconfig => $config,\n \t\tlog_msg => sub {\n \t\t\t${ $_[0] } = defined $_message\n \t\t\t\t? $_message\n-- \n2.7.4\n\n"},{"id":"312437","messageId":"20170223205452.GA29547@whir","threadId":"45191","inReplyTo":"1487731055-29153-1-git-send-email-h.shirosaki@gmail.com","subject":"Re: [PATCH] git svn branch fails with authenticaton failures","fromName":"Eric Wong","fromEmail":"e@80x24.org","sentAt":"2017-02-23T20:54:52Z","receivedAt":"2017-02-23T20:54:57Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Hiroshi Shirosaki <h.shirosaki@gmail.com> wrote:\n> I have the following authentication failure while svn rebase and\n> svn dcommit works fine without authentication failures.\n> \n> $ git svn branch v7_3\n> Copying https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx at r27519\n> to https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/v7_3...\n> Can't create session: Unable to connect to a repository at URL\n> 'https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx': No more\n> credentials or we tried too many times.\n> Authentication failed at\n> C:\\Program Files\\Git\\mingw64/libexec/git-core\\git-svn line 1200.\n> \n> I can workaround the issue to add auth configuration to\n> SVN::Client->new().\n\nMissing sign-off (see Documentation/SubmittingPatches).\nNot my rule, but it's unfortunately required for this project.\n\nAlso, the Subject: should be in the imperative mood,\nPerhaps something like:\n\nSubject: [PATCH] git svn: fix authentication with 'branch'\n\nI am less picky about the message body.\n\n> --- a/git-svn.perl\n> +++ b/git-svn.perl\n> @@ -1175,10 +1175,10 @@ sub cmd_branch {\n>  \t::_req_svn();\n>  \trequire SVN::Client;\n>  \n> +\tmy ($config, $baton, $callbacks) = Git::SVN::Ra::prepare_config_once();\n\nSince we're not using it, here, you can avoid setting a variable\nfor $callbacks more explicitly:\n\n\tmy ($config, $baton, undef) = Git::SVN::Ra::prepare_config_once();\n\n>  \tmy $ctx = SVN::Client->new(\n> -\t\tconfig => SVN::Core::config_get_config(\n> -\t\t\t$Git::SVN::Ra::config_dir\n> -\t\t),\n> +\t\tauth => $baton,\n> +\t\tconfig => $config,\n>  \t\tlog_msg => sub {\n>  \t\t\t${ $_[0] } = defined $_message\n>  \t\t\t\t? $_message\n> -- \n\nAnyways, this looks like a good change.  I will accept a v2\nwith your sign-off and changes noted above.  Thank you.\n"}]}