# [PATCH] git-svn: Avoid spurious errors when rewriteRoot is used.

3 messages from 2009-10-09 to 2009-10-09. Participants: Alexander Gavrilov, Eric Wong, Junio C Hamano.
Thread: https://gitlist.dev/t/21166

## Alexander Gavrilov, 2009-10-09 07:01

Subject: [PATCH] git-svn: Avoid spurious errors when rewriteRoot is used.
Message-ID: <200910091101.04116.angavrilov@gmail.com>
URL: https://gitlist.dev/e/200910091101.04116.angavrilov%40gmail.com

```
After doing a rebase, git-svn checks that the SVN URL
is what it expects. However, it does not account for
rewriteRoot, which is a legitimate way for the URL
to change. This produces a lot of spurious errors.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
---
 git-svn.perl |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index e0ec258..e9030ff 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -603,8 +603,12 @@ sub cmd_dcommit {
 					  "\nBefore dcommitting";
 				}
 				if ($url_ ne $expect_url) {
-					fatal "URL mismatch after rebase: ",
-					      "$url_ != $expect_url";
+					if ($url_ eq $gs->metadata_url) {
+						print "Accepting rewritten URL: $url_\n";
+					} else {
+						fatal "URL mismatch after rebase: ",
+						      "$url_ != $expect_url";
+					}
 				}
 				if ($uuid_ ne $uuid) {
 					fatal "uuid mismatch after rebase: ",
-- 
1.6.3.2.13.g94af7

```

## Eric Wong, 2009-10-09 08:34

Subject: Re: [PATCH] git-svn: Avoid spurious errors when rewriteRoot is used.
Message-ID: <20091009083444.GA31594@dcvr.yhbt.net>
URL: https://gitlist.dev/e/20091009083444.GA31594%40dcvr.yhbt.net
In-Reply-To: <200910091101.04116.angavrilov@gmail.com>

```
Alexander Gavrilov <angavrilov@gmail.com> wrote:
> After doing a rebase, git-svn checks that the SVN URL
> is what it expects. However, it does not account for
> rewriteRoot, which is a legitimate way for the URL
> to change. This produces a lot of spurious errors.
> 
> Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>

Thanks Alexander,

Acked-by: Eric Wong <normalperson@yhbt.net>

Fixed some line wrapping and pushed out to
  git://git.bogomips.org/git-svn

-- 
Eric Wong

```

## Junio C Hamano, 2009-10-09 20:44

Subject: Re: [PATCH] git-svn: Avoid spurious errors when rewriteRoot is used.
Message-ID: <7vy6nks3eo.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vy6nks3eo.fsf%40alter.siamese.dyndns.org
In-Reply-To: <20091009083444.GA31594@dcvr.yhbt.net>

```
Eric Wong <normalperson@yhbt.net> writes:

> Thanks Alexander,
>
> Acked-by: Eric Wong <normalperson@yhbt.net>
>
> Fixed some line wrapping and pushed out to
>   git://git.bogomips.org/git-svn

Thanks.

```
