git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Using git-svn fetch after a directory change with rewrite-root
@ 2011-08-08  3:26 H Krishnan
  2011-08-10 13:22 ` H Krishnan
  2011-08-20 19:18 ` Eric Wong
  0 siblings, 2 replies; 5+ messages in thread
From: H Krishnan @ 2011-08-08  3:26 UTC (permalink / raw)
  To: git

Hi,
We use git-svn to sync with SVN. We set the "rewrite-root" attribute
to a dummy URL as different people use different SVN mirrors to update
their git repository. Recently, the trunk directory in SVN was
renamed. After this, with git version 1.7.3 or later, we are not able
to fetch. We get an SVN error ("RA layer request failed: ...: 200
OK"). git version 1.7.0 seemed to work OK. On debugging further, I
found that in the following lines, $url has the rewrite-root prefix
whereas $gs->full_url has the actual url prefix and thus the "last if"
fails.

while (1) {
	# It is possible to tag two different subdirectories at
	# the same revision.  If the url for an existing ref
	# does not match, we must either find a ref with a
	# matching url or create a new ref by growing a tail.
	$gs = Git::SVN->init($u, $p, $repo_id, $ref_id, 1);
	my (undef, $max_commit) = $gs->rev_map_max(1);
	last if (!$max_commit);
	my ($url) = ::cmt_metadata($max_commit);
	last if ($url eq $gs->full_url);
	$ref_id .= '-';
}
print STDERR "Initializing parent: $ref_id\n" unless $::_q > 1;

I wonder if commit 3235b7053c45a734c1cdf9b117bda68b7ced29c9 handles
rewrite-root correctly. Should the comparison be made with
$gs->metadata_url instead of $gs->full_url?

H. Krishnan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Using git-svn fetch after a directory change with rewrite-root
  2011-08-08  3:26 Using git-svn fetch after a directory change with rewrite-root H Krishnan
@ 2011-08-10 13:22 ` H Krishnan
  2011-08-16 11:26   ` Michael Schubert
  2011-08-20 19:18 ` Eric Wong
  1 sibling, 1 reply; 5+ messages in thread
From: H Krishnan @ 2011-08-10 13:22 UTC (permalink / raw)
  To: git

Hi,

What is the procedure for getting this change into git? Should I contact the 
person who submitted the original patch?

Krishnan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Using git-svn fetch after a directory change with rewrite-root
  2011-08-10 13:22 ` H Krishnan
@ 2011-08-16 11:26   ` Michael Schubert
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Schubert @ 2011-08-16 11:26 UTC (permalink / raw)
  To: H Krishnan; +Cc: git

On 08/10/2011 03:22 PM, H Krishnan wrote: 
> What is the procedure for getting this change into git? Should I contact the 
> person who submitted the original patch?

See Documentation/SubmittingPatches in the Git source tree.

You should CC the people involved.

Cheers.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Using git-svn fetch after a directory change with rewrite-root
  2011-08-08  3:26 Using git-svn fetch after a directory change with rewrite-root H Krishnan
  2011-08-10 13:22 ` H Krishnan
@ 2011-08-20 19:18 ` Eric Wong
  2011-09-01 20:54   ` Eric Wong
  1 sibling, 1 reply; 5+ messages in thread
From: Eric Wong @ 2011-08-20 19:18 UTC (permalink / raw)
  To: H Krishnan; +Cc: git

(Apologies for the late response, I don't pay attention to
 git svn much anymore.  Feel free to Cc: me when posting to
 the mailing list and remind me in a week if I forgot respond.)

H Krishnan <hetchkay@gmail.com> wrote:
> while (1) {
> 	# It is possible to tag two different subdirectories at
> 	# the same revision.  If the url for an existing ref
> 	# does not match, we must either find a ref with a
> 	# matching url or create a new ref by growing a tail.
> 	$gs = Git::SVN->init($u, $p, $repo_id, $ref_id, 1);
> 	my (undef, $max_commit) = $gs->rev_map_max(1);
> 	last if (!$max_commit);
> 	my ($url) = ::cmt_metadata($max_commit);
> 	last if ($url eq $gs->full_url);
> 	$ref_id .= '-';
> }
> print STDERR "Initializing parent: $ref_id\n" unless $::_q > 1;
> 
> I wonder if commit 3235b7053c45a734c1cdf9b117bda68b7ced29c9 handles
> rewrite-root correctly. Should the comparison be made with
> $gs->metadata_url instead of $gs->full_url?

I think you're right, can you submit a test case?  Current
tests all pass with  $gs->metadata_url  so I can probably
push it out in a bit regardless.

-- 
Eric Wong

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Using git-svn fetch after a directory change with rewrite-root
  2011-08-20 19:18 ` Eric Wong
@ 2011-09-01 20:54   ` Eric Wong
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Wong @ 2011-09-01 20:54 UTC (permalink / raw)
  To: H Krishnan; +Cc: git

Eric Wong <normalperson@yhbt.net> wrote:
> H Krishnan <hetchkay@gmail.com> wrote:
> > I wonder if commit 3235b7053c45a734c1cdf9b117bda68b7ced29c9 handles
> > rewrite-root correctly. Should the comparison be made with
> > $gs->metadata_url instead of $gs->full_url?
> 
> I think you're right, can you submit a test case?  Current
> tests all pass with  $gs->metadata_url  so I can probably
> push it out in a bit regardless.

I've pushed the following out to git://bogomips.org/git-svn.git

>From 85f022e9c124ffeda31a50cab878e1418d694d87 Mon Sep 17 00:00:00 2001
From: Eric Wong <normalperson@yhbt.net>
Date: Mon, 29 Aug 2011 00:45:44 +0000
Subject: [PATCH] git-svn: fix fetch with moved path when using rewriteRoot

The matching step in commit 3235b7053c45a734c1cdf9b117bda68b7ced29c9
did not properly account for users of the "rewriteRoot"
configuration parameter.

ref: <CANWsHyfHtr0EaJtNsDK9UTcmb_AbLg-1jUA-0uWJ-nEeNosb7w@mail.gmail.com>

Suggested-by: H Krishnan <hetchkay@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 git-svn.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index 96f373f..32792d3 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3022,7 +3022,7 @@ sub other_gs {
 			my (undef, $max_commit) = $gs->rev_map_max(1);
 			last if (!$max_commit);
 			my ($url) = ::cmt_metadata($max_commit);
-			last if ($url eq $gs->full_url);
+			last if ($url eq $gs->metadata_url);
 			$ref_id .= '-';
 		}
 		print STDERR "Initializing parent: $ref_id\n" unless $::_q > 1;
-- 
Eric Wong

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-09-01 20:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-08  3:26 Using git-svn fetch after a directory change with rewrite-root H Krishnan
2011-08-10 13:22 ` H Krishnan
2011-08-16 11:26   ` Michael Schubert
2011-08-20 19:18 ` Eric Wong
2011-09-01 20:54   ` Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).