threads / patch / 17733

patchgit-svn: Fix for rewriteRoot URL containing username.

Subject: [PATCH] git-svn: Fix for rewriteRoot URL containing username.

## tl;dr

2 messages between Feb 11, 2009 and Feb 16, 2009. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Dévai Tamás· Feb 11, 2009, 23:14 UTC · lore

If the new svn root URL given with the svn-remote.<repo>.rewriteRoot config option (or by the --rewrite-root option to 'git svn init') contains a username (such as 'svn+ssh://username@example.com/repo'), find_by_url() cannot find the repository URL, because the URL contained in the commit message does have the username removed.

Signed-off-by: Dévai Tamás <devait@mailbox.sk>
---
 git-svn.perl |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Show changes to git-svn.perl +1 −0
diff --git a/git-svn.perl b/git-svn.perl
index 001a1d8..83cb36f 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1693,6 +1693,7 @@ sub find_by_url { # repos_root and, path are optional
 			my $prefix = '';
 			if ($rwr) {
 				$z = $rwr;
+				remove_username($z);
 			} elsif (defined $svm) {
 				$z = $svm->{source};
 				$prefix = $svm->{replace};
-- 
1.6.1.2
Eric Wong· Feb 16, 2009, 00:55 UTC · re: Dévai Tamás · lore

Re: [PATCH] git-svn: Fix for rewriteRoot URL containing username.

Dévai Tamás <devait@mailbox.sk> wrote:
Show 7 quoted lines
> If the new svn root URL given with the svn-remote.<repo>.rewriteRoot config option
> (or by the --rewrite-root option to 'git svn init') contains a username
> (such as 'svn+ssh://username@example.com/repo'), find_by_url() cannot find
> the repository URL, because the URL contained in the commit message does have
> the username removed.
> 
> Signed-off-by: Dévai Tamás <devait@mailbox.sk>
Thanks Dévai,
Acked-by: Eric Wong <normalperson@yhbt.net>
Show 18 quoted lines
> ---
>  git-svn.perl |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/git-svn.perl b/git-svn.perl
> index 001a1d8..83cb36f 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -1693,6 +1693,7 @@ sub find_by_url { # repos_root and, path are optional
>  			my $prefix = '';
>  			if ($rwr) {
>  				$z = $rwr;
> +				remove_username($z);
>  			} elsif (defined $svm) {
>  				$z = $svm->{source};
>  				$prefix = $svm->{replace};
> -- 
> 1.6.1.2

← back to recent threads