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

Re: how to skip branches on git svn clone/fetch when there are errors

From
DSDaniele Segato <daniele.bilug@gmail.com>
Date
Sep 7, 2009, 13:53 UTC
Message-ID
<9accb4400909070653s4ddb07e4k54dde8d801b4b5e4@mail.gmail.com>
In-Reply-To
<9accb4400909070634oee46b78g9270586a2b0eb4b9@mail.gmail.com>
On Mon, Sep 7, 2009 at 3:34 PM, Daniele Segato<daniele.bilug@gmail.com> wrote:
Show 10 quoted lines
> +       $SVN::Error::handler = sub {
> +               (my $err) = @_;
> +               my $errno = $err->apr_err();
> +               my $err_key = $err->expanded_message;
> +               if ($errno == 175007) {
> +                       warn "W: Ignoring error from SVN, path probably ",
> +                               "does not exist: ($errno): ",
> +                               $err->expanded_message,"\n";
> +               }
> +               return;

ups.. this should have been return inside the if and die otherwise

and the error is 170001 (wrong copy/paste)
please ignore the patch I posted before
this is the "right" one:
From a17dfb0e268e11ce70587ccb48c359348f22ad99 Mon Sep 17 00:00:00 2001
From: Daniele Segato <daniele.bilug@gmail.com>
Date: Mon, 7 Sep 2009 15:30:14 +0200
Subject: [PATCH] Ignore err:170001 authorizationfailed on checkpath
I don't know if this is the best solution to solve the issue but it does
let me download the repo skipping the problematics paths
---
 git-svn.perl |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index a366c89..80f958d 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3756,7 +3756,24 @@ sub check_path {
 		return $cache->{data}->{$path};
 	}
 	my $pool = SVN::Pool->new;
+	my $err_handler = $SVN::Error::handler;
+	$SVN::Error::handler = sub {
+		(my $err) = @_;
+		my $errno = $err->apr_err();
+		my $err_key = $err->expanded_message;
+		if ($errno == 170001) {
+			warn "W: Ignoring error from SVN, path probably ",
+				"does not exist: ($errno): ",
+				$err->expanded_message,"\n";
+			return;
+		}
+		die "Error from SVN, ($errno): ", $err->expanded_message,"\n";
+	};
+
 	my $t = $self->SUPER::check_path($path, $r, $pool);
+
+	$SVN::Error::handler = $err_handler;
+
 	$pool->clear;
 	if ($r != $cache->{r}) {
 		%{$cache->{data}} = ();
-- 
1.5.6.5
Previous: Daniele SegatoNext: Paolo Ciarrocchi
Message 7 of 9 in “how to skip branches on git svn clone/fetch when there are errors”
  1. Daniele SegatoAug 31, 2009
  2. Eric WongSep 5, 2009
  3. Daniele SegatoSep 5, 2009
  4. Eric WongSep 6, 2009
  5. Daniele SegatoSep 7, 2009
  6. Daniele SegatoSep 7, 2009
  7. Daniele SegatoSep 7, 2009
  8. Paolo CiarrocchiSep 7, 2009
  9. Daniele SegatoSep 7, 2009

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.