{"thread":{"id":"50062","subject":"error: Use of uninitialized value $hash in chomp","startedAt":"2018-12-19T02:42:50Z","lastAt":"2019-01-08T19:45:09Z","messageCount":4,"participants":["Andrew Shearer","Ævar Arnfjörð Bjarmason"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"365559","messageId":"ME1PR01MB11218735004432E3E26C66FFE1BE0@ME1PR01MB1121.ausprd01.prod.outlook.com","threadId":"50062","inReplyTo":null,"subject":"error: Use of uninitialized value $hash in chomp","fromName":"Andrew Shearer","fromEmail":"andrew@terabyte.co.nz","sentAt":"2018-12-19T02:42:42Z","receivedAt":"2018-12-19T02:42:50Z","isPatch":false,"sender":{"key":"andrew@terabyte.co.nz","avatar":null},"body":"Hello\n\nI am using a \"git svn clone\" command to extract our project history from svn into git.\nAbout 30m into the process it fails with:\n\nr50739 = 2a1491de1353b1e3cce50d8f9d383407218a44f1 (refs/remotes/git-svn)\nfatal: Cannot open '.git/Git_svn_delta_33316_0_UkxiJV': Permission denied\nUse of uninitialized value $hash in chomp at C:/Program Files/Git/mingw64/share/perl5/Git.pm line 929, <GEN11> line 36311.\nhash-object -w --stdin-paths --no-filters: command returned error: 128\n\nerror closing pipe: Bad file descriptor at C:/Program Files/Git/mingw64/libexec/git-core\\git-svn line 0.\nerror closing pipe: Bad file descriptor at C:/Program Files/Git/mingw64/libexec/git-core\\git-svn line 0.\n        (in cleanup)  at /usr/share/perl5/vendor_perl/Error.pm line 198 during global destruction.\n\nI tried updating to the latest build, 2.20.1.windows, but it still fails.\n\nThere is nothing particularly special about svn changeset 50739 that I can see compared to any other.\nAnyone know why this might be failing or how I could resolve it?\n\nThanks\nAndrew\n\n"},{"id":"365592","messageId":"874lb9fika.fsf@evledraar.gmail.com","threadId":"50062","inReplyTo":"ME1PR01MB11218735004432E3E26C66FFE1BE0@ME1PR01MB1121.ausprd01.prod.outlook.com","subject":"Re: error: Use of uninitialized value $hash in chomp","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-12-19T19:00:21Z","receivedAt":"2018-12-19T19:00:15Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Wed, Dec 19 2018, Andrew Shearer wrote:\n\n> Hello\n>\n> I am using a \"git svn clone\" command to extract our project history from svn into git.\n> About 30m into the process it fails with:\n>\n> r50739 = 2a1491de1353b1e3cce50d8f9d383407218a44f1 (refs/remotes/git-svn)\n> fatal: Cannot open '.git/Git_svn_delta_33316_0_UkxiJV': Permission denied\n> Use of uninitialized value $hash in chomp at C:/Program Files/Git/mingw64/share/perl5/Git.pm line 929, <GEN11> line 36311.\n> hash-object -w --stdin-paths --no-filters: command returned error: 128\n>\n> error closing pipe: Bad file descriptor at C:/Program Files/Git/mingw64/libexec/git-core\\git-svn line 0.\n> error closing pipe: Bad file descriptor at C:/Program Files/Git/mingw64/libexec/git-core\\git-svn line 0.\n>         (in cleanup)  at /usr/share/perl5/vendor_perl/Error.pm line 198 during global destruction.\n>\n> I tried updating to the latest build, 2.20.1.windows, but it still fails.\n>\n> There is nothing particularly special about svn changeset 50739 that I can see compared to any other.\n> Anyone know why this might be failing or how I could resolve it?\n\nThat \"Permission denied\" looks scary. Don't know how git-svn gets into\nthis, but try with this patch on top:\n\n    diff --git a/perl/Git.pm b/perl/Git.pm\n    index d856930b2e..f5d15895d3 100644\n    --- a/perl/Git.pm\n    +++ b/perl/Git.pm\n    @@ -926,7 +926,13 @@ sub hash_and_insert_object {\n                    throw Error::Simple(\"out pipe went bad\");\n            }\n\n    -       chomp(my $hash = <$in>);\n    +       my $hash = <$in>;\n    +       unless (defined $hash) {\n    +           sub noes { die \"blah\" }\n    +           noes();\n    +       } else {\n    +           chomp($hash);\n    +       }\n            unless (defined($hash)) {\n                    $self->_close_hash_and_insert_object();\n                    throw Error::Simple(\"in pipe went bad\");\n\nThen run:\n\n    perl -d $(git --exec-path)/git-svn\n\nSet a breakpoint at that \"noes\" with:\n\n  DB<1> b Git::noes\n\nContinue:\n\n  DB<2> c\n\nThen when it stops there get a backtrace with \"T\":\n\n      DB<2> T\n    @ = DB::DB called from file 'perl/Git.pm' line 931\n    . = Git::noes() called from file 'perl/Git.pm' line 932\n    . = Git::hash_and_insert_object(ref(Git), 'Makefile') called from -e line 1\n\nAnd see if you can get any other relevant info out of the debugger. See\n\"perldoc perldebug\".\n"},{"id":"365713","messageId":"ME1PR01MB11218D4953017CFE06A2B16AE1B80@ME1PR01MB1121.ausprd01.prod.outlook.com","threadId":"50062","inReplyTo":"874lb9fika.fsf@evledraar.gmail.com","subject":"RE: error: Use of uninitialized value $hash in chomp","fromName":"Andrew Shearer","fromEmail":"andrew@terabyte.co.nz","sentAt":"2018-12-21T00:15:43Z","receivedAt":"2018-12-21T00:15:53Z","isPatch":false,"sender":{"key":"andrew@terabyte.co.nz","avatar":null},"body":"Hi \nThanks for reply, but sorry I don't know how to do that - I don't have the git source code or know how to debug it.\nIs there another way I can capture logging/debugging information while running \"git svn clone\" and send it to you?\nThanks\n\nAndrew Shearer / Web Developer\nDDI 021 469 888 / andrew@terabyte.co.nz\n\n/TERABYTE\n\n-----Original Message-----\nFrom: Ævar Arnfjörð Bjarmason <avarab@gmail.com> \nSent: Thursday, 20 December 2018 8:00 AM\nTo: Andrew Shearer <andrew@terabyte.co.nz>\nCc: git@vger.kernel.org; Eric Wong <e@80x24.org>\nSubject: Re: error: Use of uninitialized value $hash in chomp\n\n\nOn Wed, Dec 19 2018, Andrew Shearer wrote:\n\n> Hello\n>\n> I am using a \"git svn clone\" command to extract our project history from svn into git.\n> About 30m into the process it fails with:\n>\n> r50739 = 2a1491de1353b1e3cce50d8f9d383407218a44f1 \n> (refs/remotes/git-svn)\n> fatal: Cannot open '.git/Git_svn_delta_33316_0_UkxiJV': Permission \n> denied Use of uninitialized value $hash in chomp at C:/Program Files/Git/mingw64/share/perl5/Git.pm line 929, <GEN11> line 36311.\n> hash-object -w --stdin-paths --no-filters: command returned error: 128\n>\n> error closing pipe: Bad file descriptor at C:/Program Files/Git/mingw64/libexec/git-core\\git-svn line 0.\n> error closing pipe: Bad file descriptor at C:/Program Files/Git/mingw64/libexec/git-core\\git-svn line 0.\n>         (in cleanup)  at /usr/share/perl5/vendor_perl/Error.pm line 198 during global destruction.\n>\n> I tried updating to the latest build, 2.20.1.windows, but it still fails.\n>\n> There is nothing particularly special about svn changeset 50739 that I can see compared to any other.\n> Anyone know why this might be failing or how I could resolve it?\n\nThat \"Permission denied\" looks scary. Don't know how git-svn gets into this, but try with this patch on top:\n\n    diff --git a/perl/Git.pm b/perl/Git.pm\n    index d856930b2e..f5d15895d3 100644\n    --- a/perl/Git.pm\n    +++ b/perl/Git.pm\n    @@ -926,7 +926,13 @@ sub hash_and_insert_object {\n                    throw Error::Simple(\"out pipe went bad\");\n            }\n\n    -       chomp(my $hash = <$in>);\n    +       my $hash = <$in>;\n    +       unless (defined $hash) {\n    +           sub noes { die \"blah\" }\n    +           noes();\n    +       } else {\n    +           chomp($hash);\n    +       }\n            unless (defined($hash)) {\n                    $self->_close_hash_and_insert_object();\n                    throw Error::Simple(\"in pipe went bad\");\n\nThen run:\n\n    perl -d $(git --exec-path)/git-svn\n\nSet a breakpoint at that \"noes\" with:\n\n  DB<1> b Git::noes\n\nContinue:\n\n  DB<2> c\n\nThen when it stops there get a backtrace with \"T\":\n\n      DB<2> T\n    @ = DB::DB called from file 'perl/Git.pm' line 931\n    . = Git::noes() called from file 'perl/Git.pm' line 932\n    . = Git::hash_and_insert_object(ref(Git), 'Makefile') called from -e line 1\n\nAnd see if you can get any other relevant info out of the debugger. See \"perldoc perldebug\".\n"},{"id":"366359","messageId":"SYXPR01MB102421E5DB0DC254B9058624E18A0@SYXPR01MB1024.ausprd01.prod.outlook.com","threadId":"50062","inReplyTo":"ME1PR01MB11218D4953017CFE06A2B16AE1B80@ME1PR01MB1121.ausprd01.prod.outlook.com","subject":"RE: error: Use of uninitialized value $hash in chomp","fromName":"Andrew Shearer","fromEmail":"andrew@terabyte.co.nz","sentAt":"2019-01-08T19:44:59Z","receivedAt":"2019-01-08T19:45:09Z","isPatch":false,"sender":{"key":"andrew@terabyte.co.nz","avatar":null},"body":"\nHi \nThanks for reply, but sorry I don't know how to do that - I don't have the git source code or know how to debug it.\nIs there another way I can capture logging/debugging information while running \"git svn clone\" and send it to you?\nThanks\n\nAndrew Shearer / Web Developer\nDDI 021 469 888 / andrew@terabyte.co.nz\n\n/TERABYTE\n\n-----Original Message-----\nFrom: Ævar Arnfjörð Bjarmason <avarab@gmail.com> \nSent: Thursday, 20 December 2018 8:00 AM\nTo: Andrew Shearer <andrew@terabyte.co.nz>\nCc: git@vger.kernel.org; Eric Wong <e@80x24.org>\nSubject: Re: error: Use of uninitialized value $hash in chomp\n\n\nOn Wed, Dec 19 2018, Andrew Shearer wrote:\n\n> Hello\n>\n> I am using a \"git svn clone\" command to extract our project history from svn into git.\n> About 30m into the process it fails with:\n>\n> r50739 = 2a1491de1353b1e3cce50d8f9d383407218a44f1 \n> (refs/remotes/git-svn)\n> fatal: Cannot open '.git/Git_svn_delta_33316_0_UkxiJV': Permission \n> denied Use of uninitialized value $hash in chomp at C:/Program Files/Git/mingw64/share/perl5/Git.pm line 929, <GEN11> line 36311.\n> hash-object -w --stdin-paths --no-filters: command returned error: 128\n>\n> error closing pipe: Bad file descriptor at C:/Program Files/Git/mingw64/libexec/git-core\\git-svn line 0.\n> error closing pipe: Bad file descriptor at C:/Program Files/Git/mingw64/libexec/git-core\\git-svn line 0.\n>         (in cleanup)  at /usr/share/perl5/vendor_perl/Error.pm line 198 during global destruction.\n>\n> I tried updating to the latest build, 2.20.1.windows, but it still fails.\n>\n> There is nothing particularly special about svn changeset 50739 that I can see compared to any other.\n> Anyone know why this might be failing or how I could resolve it?\n\nThat \"Permission denied\" looks scary. Don't know how git-svn gets into this, but try with this patch on top:\n\n    diff --git a/perl/Git.pm b/perl/Git.pm\n    index d856930b2e..f5d15895d3 100644\n    --- a/perl/Git.pm\n    +++ b/perl/Git.pm\n    @@ -926,7 +926,13 @@ sub hash_and_insert_object {\n                    throw Error::Simple(\"out pipe went bad\");\n            }\n\n    -       chomp(my $hash = <$in>);\n    +       my $hash = <$in>;\n    +       unless (defined $hash) {\n    +           sub noes { die \"blah\" }\n    +           noes();\n    +       } else {\n    +           chomp($hash);\n    +       }\n            unless (defined($hash)) {\n                    $self->_close_hash_and_insert_object();\n                    throw Error::Simple(\"in pipe went bad\");\n\nThen run:\n\n    perl -d $(git --exec-path)/git-svn\n\nSet a breakpoint at that \"noes\" with:\n\n  DB<1> b Git::noes\n\nContinue:\n\n  DB<2> c\n\nThen when it stops there get a backtrace with \"T\":\n\n      DB<2> T\n    @ = DB::DB called from file 'perl/Git.pm' line 931\n    . = Git::noes() called from file 'perl/Git.pm' line 932\n    . = Git::hash_and_insert_object(ref(Git), 'Makefile') called from -e line 1\n\nAnd see if you can get any other relevant info out of the debugger. See \"perldoc perldebug\".\n"}]}