{"thread":{"id":"13698","subject":"[BISECTED] git-svn: \"Failed to read object ...\" during clone","startedAt":"2008-05-28T03:01:28Z","lastAt":"2008-05-28T14:19:05Z","messageCount":4,"participants":["Björn Steinbrink","Junio C Hamano","Sam Vilain"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"77909","messageId":"20080528030128.GA28904@atjola.homenet","threadId":"13698","inReplyTo":null,"subject":"[BISECTED] git-svn: \"Failed to read object ...\" during clone","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2008-05-28T03:01:28Z","receivedAt":"2008-05-28T03:01:28Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"Hi Adam,\n\nwhen cloning the SVN repository at svn://svn.debian.org/estron/ git-svn bails\nout with:\nFailed to read object e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 at\n/usr/local/bin/git-svn line 3195, <GEN36> line 645.\n\nBisection led to:\nffe256f9bac8a40ff751a9341a5869d98f72c285 is first bad commit\ncommit ffe256f9bac8a40ff751a9341a5869d98f72c285\nAuthor: Adam Roben <aroben@apple.com>\nDate:   Fri May 23 16:19:41 2008 +0200\n\n    git-svn: Speed up fetch\n    \n    We were spending a lot of time forking/execing git-cat-file and\n    git-hash-object. We now maintain a global Git repository object in order to use\n    Git.pm's more efficient hash_and_insert_object and cat_blob methods.\n\nI can reliable reproduce the problem using this command:\ngit svn clone -r215:230 svn://svn.debian.org/estron/trunk\n\n$ git --version\ngit version 1.5.6.rc0.13.g2d392\n$ git svn --version\ngit-svn version 1.5.6.rc0.13.g2d392 (svn 1.4.6)\n\nBjörn\n"},{"id":"77915","messageId":"7vskw3vsys.fsf@gitster.siamese.dyndns.org","threadId":"13698","inReplyTo":"20080528030128.GA28904@atjola.homenet","subject":"Re: [BISECTED] git-svn: \"Failed to read object ...\" during clone","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-05-28T06:32:59Z","receivedAt":"2008-05-28T06:32:59Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Björn Steinbrink <B.Steinbrink@gmx.de> writes:\n\n> Hi Adam,\n>\n> when cloning the SVN repository at svn://svn.debian.org/estron/ git-svn bails\n> out with:\n> Failed to read object e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 at\n> /usr/local/bin/git-svn line 3195, <GEN36> line 645.\n\nHeh, I should have been more careful.  The series introduces Git::cat_blob\nthat returns the size of a blob but the interface is broken and signals\nerror by returning zero.  e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 is a\nzero sized blob.\n\nWould this be enough?\n\n---\n\n git-svn.perl |    4 ++--\n perl/Git.pm  |    4 ++--\n 2 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 37976f2..3a6eb1c 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -3191,7 +3191,7 @@ sub apply_textdelta {\n \tif ($fb->{blob}) {\n \t\tprint $base 'link ' if ($fb->{mode_a} == 120000);\n \t\tmy $size = $::_repository->cat_blob($fb->{blob}, $base);\n-\t\tdie \"Failed to read object $fb->{blob}\" unless $size;\n+\t\tdie \"Failed to read object $fb->{blob}\" if ($size < 0);\n \n \t\tif (defined $exp) {\n \t\t\tseek $base, 0, 0 or croak $!;\n@@ -3570,7 +3570,7 @@ sub chg_file {\n \t\t$self->change_file_prop($fbat,'svn:special',undef);\n \t}\n \tmy $size = $::_repository->cat_blob($m->{sha1_b}, $fh);\n-\tcroak \"Failed to read object $m->{sha1_b}\" unless $size;\n+\tcroak \"Failed to read object $m->{sha1_b}\" if ($size < 0);\n \t$fh->flush == 0 or croak $!;\n \tseek $fh, 0, 0 or croak $!;\n \ndiff --git a/perl/Git.pm b/perl/Git.pm\nindex 6ba8ee5..d05b633 100644\n--- a/perl/Git.pm\n+++ b/perl/Git.pm\n@@ -811,12 +811,12 @@ sub cat_blob {\n \tmy $description = <$in>;\n \tif ($description =~ / missing$/) {\n \t\tcarp \"$sha1 doesn't exist in the repository\";\n-\t\treturn 0;\n+\t\treturn -1;\n \t}\n \n \tif ($description !~ /^[0-9a-fA-F]{40} \\S+ (\\d+)$/) {\n \t\tcarp \"Unexpected result returned from git cat-file\";\n-\t\treturn 0;\n+\t\treturn -1;\n \t}\n \n \tmy $size = $1;\n"},{"id":"77917","messageId":"483D098D.5010302@vilain.net","threadId":"13698","inReplyTo":"7vskw3vsys.fsf@gitster.siamese.dyndns.org","subject":"Re: [BISECTED] git-svn: \"Failed to read object ...\" during clone","fromName":"Sam Vilain","fromEmail":"sam@vilain.net","sentAt":"2008-05-28T07:28:13Z","receivedAt":"2008-05-28T07:28:13Z","isPatch":false,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"Junio C Hamano wrote:\n> Heh, I should have been more careful.  The series introduces Git::cat_blob\n> that returns the size of a blob but the interface is broken and signals\n> error by returning zero.  e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 is a\n> zero sized blob.\n> \n> Would this be enough?\n>  \t\tmy $size = $::_repository->cat_blob($fb->{blob}, $base);\n> -\t\tdie \"Failed to read object $fb->{blob}\" unless $size;\n> +\t\tdie \"Failed to read object $fb->{blob}\" if ($size < 0);\n\nHeh.  This sort of thing is why perl has \"undef\"; you could make that\n\"unless defined $size\" and \"return undef\" in the functions.\n\nSam\n"},{"id":"77934","messageId":"20080528141905.GA17387@atjola.homenet","threadId":"13698","inReplyTo":"7vskw3vsys.fsf@gitster.siamese.dyndns.org","subject":"Re: [BISECTED] git-svn: \"Failed to read object ...\" during clone","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2008-05-28T14:19:05Z","receivedAt":"2008-05-28T14:19:05Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"On 2008.05.27 23:32:59 -0700, Junio C Hamano wrote:\n> Björn Steinbrink <B.Steinbrink@gmx.de> writes:\n> \n> > Hi Adam,\n> >\n> > when cloning the SVN repository at svn://svn.debian.org/estron/ git-svn bails\n> > out with:\n> > Failed to read object e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 at\n> > /usr/local/bin/git-svn line 3195, <GEN36> line 645.\n> \n> Heh, I should have been more careful.  The series introduces Git::cat_blob\n> that returns the size of a blob but the interface is broken and signals\n> error by returning zero.  e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 is a\n> zero sized blob.\n> \n> Would this be enough?\n\nAt least the failing clone command now works and the history for the\npreviously empty .cvsignore file (which I guess was the one that caused\nthe failure) looks good. Didn't check anything else on that clone,\nbecause I had just randomly chosen that repository to test something\ncompletely different and then noticed the clone failure.\n\nThanks,\nBjörn\n"}]}