git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org, "Randal L. Schwartz" <merlyn@stonehenge.com>
Subject: [PATCH] git-svn: extra error check to ensure we open a file correctly
Date: Fri, 8 Dec 2006 01:55:19 -0800	[thread overview]
Message-ID: <20061208095519.GA27272@soma> (raw)
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:
> "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

      parent reply	other threads:[~2006-12-08  9:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-04  4:00 latest update to git-svn blows up for me Randal L. Schwartz
2006-12-04  7:00 ` Eric Wong
2006-12-04 11:41   ` Randal L. Schwartz
2006-12-04 18:12     ` Eric Wong
2006-12-04 19:36       ` Randal L. Schwartz
2006-12-04 19:54         ` Eric Wong
2006-12-04 20:04           ` Randal L. Schwartz
2006-12-04 20:08             ` Eric Wong
2006-12-04 20:10               ` Randal L. Schwartz
2006-12-04 20:51                 ` Eric Wong
2006-12-05  4:08                   ` Eric Wong
2006-12-05  4:19                     ` Randal L. Schwartz
2006-12-05  4:33                       ` Randal L. Schwartz
2006-12-05  9:13                         ` Eric Wong
2006-12-05 16:47                         ` Linus Torvalds
2006-12-08  9:55       ` Eric Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061208095519.GA27272@soma \
    --to=normalperson@yhbt.net \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=merlyn@stonehenge.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).