Git development
 help / color / mirror / Atom feed
From: Martin Langhoff <martin.langhoff@gmail.com>
To: Matthias Urlichs <smurf@smurf.noris.de>,
	Sven Verdoolaege <skimo@kotnet.org>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: git-cvsimport: $cvs->file() fails silently
Date: Tue, 1 Nov 2005 14:22:37 +1300	[thread overview]
Message-ID: <46a038f90510311722y56eadd3bj1ae53db05c496c67@mail.gmail.com> (raw)
In-Reply-To: <46a038f90510262123y4f56cf7v5494b391394ac648@mail.gmail.com>

On 10/27/05, Martin Langhoff <martin.langhoff@gmail.com> wrote:
> There _must_ be one place that we're missing but I just can't
> see it.

Got some more info on this. The output of cvsimport when this happens
looks like this:

Read from remote host cvs.sourceforge.net: Connection reset by peer
Read from remote host cvs.sourceforge.net: Connection reset by peer
Update course/enrol.php:  bytes
Use of uninitialized value in split at
/home/martin/local/git/git-cvsimport line 362.
Update lang/en/moodle.php: 66792 bytes
Tree ID ef11ad5a0cf917e98bc477837de1b3f587e12027
Parent ID e972b3a28e1c4802fc5af6a996164c93fb4f3e53
Committed patch 20143 (MOODLE_15_STABLE 2005-10-31 20:31:57)
Commit ID 95a748b0d9cd6dc74e65497561514fa5858c149c

Around line 335  $res = $self->_line($fh); is returning '', which is
defined but otherwise empty. I've patched cvsimport thus to try and
catch this kind of error:

diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index bbb83fb..f594df3 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -337,6 +337,10 @@ sub file {
        }
        close ($fh);

+       if ($res eq '') {
+           die "Looks like the server has gone away during the transaction!";
+       }
+
        return ($name, $res);
 }

@@ -764,6 +768,9 @@ while(<CVS>) {
                my $rev = $3;
                $fn =~ s#^/+##;
                my ($tmpname, $size) = $cvs->file($fn,$rev);
+               if ($size eq '') {
+                       die "Should not happen! Something went wrong
with the remote connection";
+               }
                if($size == -1) {
                        push(@old,$fn);
                        print "Drop $fn\n" if $opt_v;

Now, I'm sure we can catch it in the "right" place, but I'm not sure
where that is.

cheers,


martin

      reply	other threads:[~2005-11-01  1:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-27  4:23 git-cvsimport: $cvs->file() fails silently Martin Langhoff
2005-11-01  1:22 ` Martin Langhoff [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=46a038f90510311722y56eadd3bj1ae53db05c496c67@mail.gmail.com \
    --to=martin.langhoff@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=skimo@kotnet.org \
    --cc=smurf@smurf.noris.de \
    /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