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

[PATCH] git-svn: extra error check to ensure we open a file correctly

From
EWEric Wong <normalperson@yhbt.net>
Date
Dec 8, 2006, 09:55 UTC
Message-ID
<20061208095519.GA27272@soma>
In-Reply-To
<20061204181241.GA27342@soma>

This may be an issue with repositories imported with commit 27a1a8014b842c0d70fdc91c68dd361ca2dfb34c or later, but before commit dad73c0bb9f33323ec1aacf560a6263f1d85f81a.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
Eric Wong <normalperson@yhbt.net> wrote:
Show 15 quoted lines
> "Randal L. Schwartz" <merlyn@stonehenge.com> wrote:
> > >>>>> "Eric" == Eric Wong <normalperson@yhbt.net> writes:
> > 
> > Eric> "Randal L. Schwartz" <merlyn@stonehenge.com> wrote:
> > >> 
> > >> Does this ring a bell?
> > 
> > Eric> Nope.
> > 
> > Eric> This is on r15941 of  https://svn.perl.org/parrot/trunk ?  I can't seem
> > Eric> to reproduce this with git svn fetch -r15940:15941
> > 
> > No, and that worked for me as well.  Apparently, I might have corrupted my
> > metadata because I updated git-svn while I was using it.  Is there any way to
> > reset the metadata without having to re-fetch 15000 revisions?

I fear I may have been looking in the wrong place while trying to diagnose merlyn's problem. He did mention he was on a flaky connection and that may have caused the corruption if he had one of those bad versions.

 git-svn.perl |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 747daf0..ff61b92 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3438,6 +3438,9 @@ sub open_file {
 	my ($self, $path, $pb, $rev) = @_;
 	my ($mode, $blob) = (safe_qx('git-ls-tree',$self->{c},'--',$path)
 	                     =~ /^(\d{6}) blob ([a-f\d]{40})\t/);
+	unless (defined $mode && defined $blob) {
+		die "$path was not found in commit $self->{c} (r$rev)\n";
+	}
 	{ path => $path, mode_a => $mode, mode_b => $mode, blob => $blob,
 	  pool => SVN::Pool->new, action => 'M' };
 }
-- 
1.4.4.1.g9c35e-dirty
Previous: Linus Torvalds
Message 16 of 16 in “latest update to git-svn blows up for me”
  1. Randal L. SchwartzDec 4, 2006
  2. Eric WongDec 4, 2006
  3. Randal L. SchwartzDec 4, 2006
  4. Eric WongDec 4, 2006
  5. Randal L. SchwartzDec 4, 2006
  6. Eric WongDec 4, 2006
  7. Randal L. SchwartzDec 4, 2006
  8. Eric WongDec 4, 2006
  9. Randal L. SchwartzDec 4, 2006
  10. Eric WongDec 4, 2006
  11. Eric WongDec 5, 2006
  12. Randal L. SchwartzDec 5, 2006
  13. Randal L. SchwartzDec 5, 2006
  14. Eric WongDec 5, 2006
  15. Linus TorvaldsDec 5, 2006
  16. git-svn: extra error check to ensure we open a file correctlyEric Wong, Dec 8, 2006

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.