threads / patch / 45191

patchgit svn branch fails with authenticaton failures

Subject: [PATCH] git svn branch fails with authenticaton failures

## tl;dr

2 messages between Feb 22, 2017 and Feb 23, 2017. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Hiroshi Shirosaki· Feb 22, 2017, 02:37 UTC · lore

I have the following authentication failure while svn rebase and svn dcommit works fine without authentication failures.

$ git svn branch v7_3 Copying https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx at r27519 to https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/v7_3... Can't create session: Unable to connect to a repository at URL 'https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx': No more credentials or we tried too many times. Authentication failed at C:\Program Files\Git\mingw64/libexec/git-core\git-svn line 1200.

I can workaround the issue to add auth configuration to
SVN::Client->new().
---
 git-svn.perl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Show changes to git-svn.perl +3 −3
diff --git a/git-svn.perl b/git-svn.perl
index fa42364..13fa4ad 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1175,10 +1175,10 @@ sub cmd_branch {
 	::_req_svn();
 	require SVN::Client;
 
+	my ($config, $baton, $callbacks) = Git::SVN::Ra::prepare_config_once();
 	my $ctx = SVN::Client->new(
-		config => SVN::Core::config_get_config(
-			$Git::SVN::Ra::config_dir
-		),
+		auth => $baton,
+		config => $config,
 		log_msg => sub {
 			${ $_[0] } = defined $_message
 				? $_message
-- 
2.7.4
Eric Wong· Feb 23, 2017, 20:54 UTC · re: Hiroshi Shirosaki · lore

Re: [PATCH] git svn branch fails with authenticaton failures

Hiroshi Shirosaki <h.shirosaki@gmail.com> wrote:
Show 14 quoted lines
> I have the following authentication failure while svn rebase and
> svn dcommit works fine without authentication failures.
> 
> $ git svn branch v7_3
> Copying https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx at r27519
> to https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/v7_3...
> Can't create session: Unable to connect to a repository at URL
> 'https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx': No more
> credentials or we tried too many times.
> Authentication failed at
> C:\Program Files\Git\mingw64/libexec/git-core\git-svn line 1200.
> 
> I can workaround the issue to add auth configuration to
> SVN::Client->new().

Missing sign-off (see Documentation/SubmittingPatches). Not my rule, but it's unfortunately required for this project.

Also, the Subject: should be in the imperative mood, Perhaps something like:

Subject: [PATCH] git svn: fix authentication with 'branch'
I am less picky about the message body.
Show 7 quoted lines
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -1175,10 +1175,10 @@ sub cmd_branch {
>  	::_req_svn();
>  	require SVN::Client;
>  
> +	my ($config, $baton, $callbacks) = Git::SVN::Ra::prepare_config_once();

Since we're not using it, here, you can avoid setting a variable for $callbacks more explicitly:

	my ($config, $baton, undef) = Git::SVN::Ra::prepare_config_once();
Show 10 quoted lines
>  	my $ctx = SVN::Client->new(
> -		config => SVN::Core::config_get_config(
> -			$Git::SVN::Ra::config_dir
> -		),
> +		auth => $baton,
> +		config => $config,
>  		log_msg => sub {
>  			${ $_[0] } = defined $_message
>  				? $_message
> -- 

Anyways, this looks like a good change. I will accept a v2 with your sign-off and changes noted above. Thank you.

← back to recent threads