git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Using git-svn fetch after a directory change with rewrite-root

From
HKH Krishnan <hetchkay@gmail.com>
Date
Aug 8, 2011, 03:26 UTC
Message-ID
<CANWsHyfHtr0EaJtNsDK9UTcmb_AbLg-1jUA-0uWJ-nEeNosb7w@mail.gmail.com>

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
Next: H Krishnan
Message 1 of 5 in “Using git-svn fetch after a directory change with rewrite-root”
  1. H KrishnanAug 8, 2011
  2. H KrishnanAug 10, 2011
  3. Michael SchubertAug 16, 2011
  4. Eric WongAug 20, 2011
  5. Eric WongSep 1, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.