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

[PATCH] Escape file:// URL's to meet subversion SVN::Ra requirements

From
Ben Walton <bwalton@artsci.utoronto.ca>
Date
Nov 2, 2011, 16:38 UTC
Message-ID
<1320251895-6348-2-git-send-email-bwalton@artsci.utoronto.ca>
In-Reply-To
<1320251895-6348-1-git-send-email-bwalton@artsci.utoronto.ca>

Previously only http/https URL's were uri escaped. When building against subversion 1.7, this was causing a segfault in perl after an assertion failure in the SVN::Ra bindings during in t9134.

Changing 'trash directory' to 'trash_directory' worked around the problem.

After a colleague reported this problem to the subversion list, it was determined that the problem is in git, not svn.[1] The SVN code expects URL's and paths to be pre-escaped.

We now also escape file:// URL's in the Git::SVN::Ra->escape_url code path.

[1] http://news.gmane.org/gmane.comp.version-control.subversion.devel
Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
---
 git-svn.perl |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 351e743..b00c188 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -5366,6 +5366,9 @@ sub escape_url {
 	if ($url =~ m#^(https?)://([^/]+)(.*)$#) {
 		my ($scheme, $domain, $uri) = ($1, $2, escape_uri_only($3));
 		$url = "$scheme://$domain$uri";
+	} elsif ($url =~ m#^(file)://(.*)$#) {
+		my ($scheme, $uri) = ($1, escape_uri_only($2));
+		$url = "$scheme://$uri";
 	}
 	$url;
 }
-- 
1.7.7.1
Previous: Ben WaltonNext: Jonathan Nieder
Message 2 of 11 in “(unknown)”
  1. Ben WaltonNov 2, 2011
  2. Escape file:// URL's to meet subversion SVN::Ra requirementsBen Walton, Nov 2, 2011
  3. Jonathan NiederNov 2, 2011
  4. Ben WaltonNov 2, 2011
  5. Eric WongNov 2, 2011
  6. Ben WaltonNov 4, 2011
  7. Jonathan NiederNov 4, 2011
  8. Michael WittenJul 16, 2012
  9. Jonathan NiederDec 17, 2011
  10. Jonathan NiederDec 17, 2011
  11. Ben WaltonDec 17, 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.