{"thread":{"id":"15864","subject":"[PATCH] Git.pm: release hash and blob handles","startedAt":"2008-10-11T19:29:28Z","lastAt":"2008-10-11T21:23:22Z","messageCount":2,"participants":["Ray Chuan","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"92807","messageId":"be6fef0d0810111229u60c28671w1afd952200c6fa23@mail.gmail.com","threadId":"15864","inReplyTo":null,"subject":"[PATCH] Git.pm: release hash and blob handles","fromName":"Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2008-10-11T19:29:28Z","receivedAt":"2008-10-11T19:29:28Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"the methods\n\n * hash_and_insert_object\n * cat_blob\n\nuse bidirectional pipes to pull/push data from the various git\nutilities, but they don't close them after this is complete. this\ndenies Git's subsequent attempts to use these resources, leading to\nfailure.\n\na simple, reproducible test case can be seen at\nhttp://rctay.spaces.live.com/blog/cns!59D3BFCD027B09E5!792.entry.\n\nSigned-off-by: Tay Ray Chuan <rctay89 <at> gmail.com>\n---\n perl/Git.pm |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/perl/Git.pm b/perl/Git.pm\nindex 6aab712..7e17f38 100644\n--- a/perl/Git.pm\n+++ b/perl/Git.pm\n@@ -821,6 +821,7 @@ sub hash_and_insert_object {\n \t\tthrow Error::Simple(\"in pipe went bad\");\n \t}\n\n+\t$self->_close_hash_and_insert_object();\n \treturn $hash;\n }\n\n@@ -910,6 +911,7 @@ sub cat_blob {\n \t\tthrow Error::Simple(\"couldn't write to passed in filehandle\");\n \t}\n\n+\t$self->_close_cat_blob();\n \treturn $size;\n }\n\n--\n1.6.0.2\n"},{"id":"92809","messageId":"20081011212322.GU10544@machine.or.cz","threadId":"15864","inReplyTo":"be6fef0d0810111229u60c28671w1afd952200c6fa23@mail.gmail.com","subject":"Re: [PATCH] Git.pm: release hash and blob handles","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-10-11T21:23:22Z","receivedAt":"2008-10-11T21:23:22Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Sun, Oct 12, 2008 at 03:29:28AM +0800, Ray Chuan wrote:\n> the methods\n> \n>  * hash_and_insert_object\n>  * cat_blob\n> \n> use bidirectional pipes to pull/push data from the various git\n> utilities, but they don't close them after this is complete. this\n> denies Git's subsequent attempts to use these resources, leading to\n> failure.\n> \n> a simple, reproducible test case can be seen at\n> http://rctay.spaces.live.com/blog/cns!59D3BFCD027B09E5!792.entry.\n\nHmm, I don't understand why git-svn does not work for you, but this\npatch is not correct. The whole point of the infrastructure is to leave\nthe pipes open so that subsequent calls _reuse_ these pipes. This leads\nto substantial speedup as you do not need to re-fork git all the time.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nPeople who take cold baths never have rheumatism, but they have\ncold baths.\n"}]}