{"thread":{"id":"4980","subject":"[PATCH] cvsserver: avoid warning about active db handles","startedAt":"2006-07-25T11:57:57Z","lastAt":"2006-07-27T14:32:19Z","messageCount":21,"participants":["Johannes Schindelin","Martin Langhoff (CatalystIT)","Petr Baudis","Jakub Narebski","Luben Tuikov","Randal L. Schwartz"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"24089","messageId":"Pine.LNX.4.63.0607251356430.29667@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"4980","inReplyTo":null,"subject":"[PATCH] cvsserver: avoid warning about active db handles","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-07-25T11:57:57Z","receivedAt":"2006-07-25T11:57:57Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nTurns out that DBD::SQLite does not favour preparing statements which are\nnever executed. So, turn all 4 statements, which were prepared _always_,\ninto methods, like the other 12 prepared statements.\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n---\n\tNow, the only warning left is the gzip one...\n\n git-cvsserver.perl |   70 ++++++++++++++++++++++++++++++++++++++++++----------\n 1 files changed, 56 insertions(+), 14 deletions(-)\n\ndiff --git a/git-cvsserver.perl b/git-cvsserver.perl\nindex 981b6ba..b2837ad 100755\n--- a/git-cvsserver.perl\n+++ b/git-cvsserver.perl\n@@ -2131,12 +2131,6 @@ sub update\n     # first lets get the commit list\n     $ENV{GIT_DIR} = $self->{git_path};\n \n-    # prepare database queries\n-    my $db_insert_rev = $self->{dbh}->prepare_cached(\"INSERT INTO revision (name, revision, filehash, commithash, modified, author, mode) VALUES (?,?,?,?,?,?,?)\",{},1);\n-    my $db_insert_mergelog = $self->{dbh}->prepare_cached(\"INSERT INTO commitmsgs (key, value) VALUES (?,?)\",{},1);\n-    my $db_delete_head = $self->{dbh}->prepare_cached(\"DELETE FROM head\",{},1);\n-    my $db_insert_head = $self->{dbh}->prepare_cached(\"INSERT INTO head (name, revision, filehash, commithash, modified, author, mode) VALUES (?,?,?,?,?,?,?)\",{},1);\n-\n     my $commitinfo = `git-cat-file commit $self->{module} 2>&1`;\n     unless ( $commitinfo =~ /tree\\s+[a-zA-Z0-9]{40}/ )\n     {\n@@ -2325,7 +2319,7 @@ sub update\n                         author => $commit->{author},\n                         mode => $git_perms,\n                     };\n-                    $db_insert_rev->execute($4, $head->{$4}{revision}, $2, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);\n+                    $self->insert_rev($4, $head->{$4}{revision}, $2, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);\n                 }\n                 elsif ( $3 eq \"M\" )\n                 {\n@@ -2339,7 +2333,7 @@ sub update\n                         author => $commit->{author},\n                         mode => $git_perms,\n                     };\n-                    $db_insert_rev->execute($4, $head->{$4}{revision}, $2, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);\n+                    $self->insert_rev($4, $head->{$4}{revision}, $2, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);\n                 }\n                 elsif ( $3 eq \"A\" )\n                 {\n@@ -2353,7 +2347,7 @@ sub update\n                         author => $commit->{author},\n                         mode => $git_perms,\n                     };\n-                    $db_insert_rev->execute($4, $head->{$4}{revision}, $2, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);\n+                    $self->insert_rev($4, $head->{$4}{revision}, $2, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);\n                 }\n                 else\n                 {\n@@ -2410,7 +2404,7 @@ sub update\n                     };\n \n \n-                    $db_insert_rev->execute($git_filename, $newrevision, $git_hash, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);\n+                    $self->insert_rev($git_filename, $newrevision, $git_hash, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);\n                 }\n             }\n             close FILELIST;\n@@ -2426,7 +2420,7 @@ sub update\n                     $head->{$file}{modified} = $commit->{date};\n                     $head->{$file}{author} = $commit->{author};\n \n-                    $db_insert_rev->execute($file, $head->{$file}{revision}, $head->{$file}{filehash}, $commit->{hash}, $commit->{date}, $commit->{author}, $head->{$file}{mode});\n+                    $self->insert_rev($file, $head->{$file}{revision}, $head->{$file}{filehash}, $commit->{hash}, $commit->{date}, $commit->{author}, $head->{$file}{mode});\n                 }\n             }\n             # END : \"Detect deleted files\"\n@@ -2435,7 +2429,7 @@ sub update\n \n         if (exists $commit->{mergemsg})\n         {\n-            $db_insert_mergelog->execute($commit->{hash}, $commit->{mergemsg});\n+            $self->insert_mergelog($commit->{hash}, $commit->{mergemsg});\n         }\n \n         $lastpicked = $commit->{hash};\n@@ -2443,10 +2437,10 @@ sub update\n         $self->_set_prop(\"last_commit\", $commit->{hash});\n     }\n \n-    $db_delete_head->execute();\n+    $self->delete_head();\n     foreach my $file ( keys %$head )\n     {\n-        $db_insert_head->execute(\n+        $self->insert_head(\n             $file,\n             $head->{$file}{revision},\n             $head->{$file}{filehash},\n@@ -2464,6 +2458,54 @@ sub update\n     $self->{dbh}->commit() or die \"Failed to commit changes to SQLite\";\n }\n \n+sub insert_rev\n+{\n+    my $self = shift;\n+    my $name = shift;\n+    my $revision = shift;\n+    my $filehash = shift;\n+    my $commithash = shift;\n+    my $modified = shift;\n+    my $author = shift;\n+    my $mode = shift;\n+\n+    my $insert_rev = $self->{dbh}->prepare_cached(\"INSERT INTO revision (name, revision, filehash, commithash, modified, author, mode) VALUES (?,?,?,?,?,?,?)\",{},1);\n+    $insert_rev->execute($name, $revision, $filehash, $commithash, $modified, $author, $mode);\n+}\n+\n+sub insert_mergelog\n+{\n+    my $self = shift;\n+    my $key = shift;\n+    my $value = shift;\n+\n+    my $insert_mergelog = $self->{dbh}->prepare_cached(\"INSERT INTO commitmsgs (key, value) VALUES (?,?)\",{},1);\n+    $insert_mergelog->execute($key, $value);\n+}\n+\n+sub delete_head\n+{\n+    my $self = shift;\n+\n+    my $delete_head = $self->{dbh}->prepare_cached(\"DELETE FROM head\",{},1);\n+    $delete_head->execute();\n+}\n+\n+sub insert_head\n+{\n+    my $self = shift;\n+    my $name = shift;\n+    my $revision = shift;\n+    my $filehash = shift;\n+    my $commithash = shift;\n+    my $modified = shift;\n+    my $author = shift;\n+    my $mode = shift;\n+\n+    my $insert_head = $self->{dbh}->prepare_cached(\"INSERT INTO head (name, revision, filehash, commithash, modified, author, mode) VALUES (?,?,?,?,?,?,?)\",{},1);\n+    $insert_head->execute($name, $revision, $filehash, $commithash, $modified, $author, $mode);\n+}\n+\n sub _headrev\n {\n     my $self = shift;\n-- \n1.4.2.rc1.gd3c5-dirty\n"},{"id":"24091","messageId":"44C6099A.5010205@catalyst.net.nz","threadId":"4980","inReplyTo":"Pine.LNX.4.63.0607251356430.29667@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] cvsserver: avoid warning about active db handles","fromName":"Martin Langhoff (CatalystIT)","fromEmail":"martin@catalyst.net.nz","sentAt":"2006-07-25T12:07:54Z","receivedAt":"2006-07-25T12:07:54Z","isPatch":true,"sender":{"key":"martin@laptop.org","avatar":null},"body":"Johannes Schindelin wrote:\n\n> Turns out that DBD::SQLite does not favour preparing statements which are\n> never executed. So, turn all 4 statements, which were prepared _always_,\n> into methods, like the other 12 prepared statements.\n\nCan you give me a reference for that \"does not favour preparing \nstatements\"? I have some vague recollection of timing \nprepared/unprepared inserts and getting a huge difference in \nperformance. Looking at the source of SQLite.pm doesn't clarify much -- \nprepare_cached is actually implemented by DBI, the driver doesn't need \nto implement it. Anyway, I guess it has to do with the cost of preparing \nit in the lower level driver anyway.\n\n\n> \tNow, the only warning left is the gzip one...\n\nThat's harder. I wonder whether using libgit's XS module we can now get \nlibgit to give us a gzipped file directly. I guess it only has \nperformance savings for unpacked repos.\n\ncheers,\n\n\nmartin\n-- \n-----------------------------------------------------------------------\nMartin @ Catalyst .Net .NZ  Ltd, PO Box 11-053, Manners St,  Wellington\nWEB: http://catalyst.net.nz/           PHYS: Level 2, 150-154 Willis St\nOFFICE: +64(4)916-7224                              MOB: +64(21)364-017\n       Make things as simple as possible, but no simpler - Einstein\n-----------------------------------------------------------------------\n"},{"id":"24093","messageId":"Pine.LNX.4.63.0607251649190.29667@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"4980","inReplyTo":"44C6099A.5010205@catalyst.net.nz","subject":"Re: [PATCH] cvsserver: avoid warning about active db handles","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-07-25T14:53:16Z","receivedAt":"2006-07-25T14:53:16Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\n[sorry for the delay... darn meetings]\n\nOn Wed, 26 Jul 2006, Martin Langhoff (CatalystIT) wrote:\n\n> Johannes Schindelin wrote:\n> \n> > Turns out that DBD::SQLite does not favour preparing statements which \n> > are never executed. So, turn all 4 statements, which were prepared \n> > _always_, into methods, like the other 12 prepared statements.\n> \n> Can you give me a reference for that \"does not favour preparing \n> statements\"?\n\nThe relevant bug entry is\n\n\thttp://rt.cpan.org/Public/Bug/Display.html?id=17603\n\n> I have some vague recollection of timing prepared/unprepared inserts and \n> getting a huge difference in performance.\n\nYes, preparing before executing is a wonderful thing. But you need to \nexecute the prepared statements; otherwise it is a waste of resources \n(plus, it does not finalize with DBD::SQLite).\n\n> Looking at the source of SQLite.pm doesn't clarify much -- \n> prepare_cached is actually implemented by DBI, the driver doesn't need \n> to implement it.\n\nYes. The culprit is in prepare().\n\n> > \tNow, the only warning left is the gzip one...\n> \n> That's harder. I wonder whether using libgit's XS module we can now get \n> libgit to give us a gzipped file directly. I guess it only has \n> performance savings for unpacked repos.\n\nI still have the problem on at least two of my boxes that Git.xs does not \nload. The next thing after looking into the gzip thing is to rewrite \ngit-mv in C.\n\nCiao,\nDscho\n"},{"id":"24095","messageId":"20060725155259.GU13776@pasky.or.cz","threadId":"4980","inReplyTo":"Pine.LNX.4.63.0607251649190.29667@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] cvsserver: avoid warning about active db handles","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-07-25T15:52:59Z","receivedAt":"2006-07-25T15:52:59Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"  Hi,\n\nDear diary, on Tue, Jul 25, 2006 at 04:53:16PM CEST, I got a letter\nwhere Johannes Schindelin <Johannes.Schindelin@gmx.de> said that...\n> > That's harder. I wonder whether using libgit's XS module we can now get \n> > libgit to give us a gzipped file directly. I guess it only has \n> > performance savings for unpacked repos.\n\n  the object in the database is compressed together with the header, so\nwe have to recompress it anyway.\n\n> I still have the problem on at least two of my boxes that Git.xs does not \n> load.\n\n  What is the problem? I must have overlooked it, sorry. :-(\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nSnow falling on Perl. White noise covering line noise.\nHides all the bugs too. -- J. Putnam\n"},{"id":"24096","messageId":"Pine.LNX.4.63.0607251809340.29667@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"4980","inReplyTo":"20060725155259.GU13776@pasky.or.cz","subject":"Git.xs problem, was Re: [PATCH] cvsserver: avoid warning about active db handles","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-07-25T16:10:29Z","receivedAt":"2006-07-25T16:10:29Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 25 Jul 2006, Petr Baudis wrote:\n\n>   Hi,\n> \n> Dear diary, on Tue, Jul 25, 2006 at 04:53:16PM CEST, I got a letter\n> where Johannes Schindelin <Johannes.Schindelin@gmx.de> said that...\n> \n> > I still have the problem on at least two of my boxes that Git.xs does not \n> > load.\n> \n>   What is the problem? I must have overlooked it, sorry. :-(\n\nStill that darn private_Error.pm thing requiring Scalar::Util, IIRC.\n\nCiao,\nDscho\n"},{"id":"24111","messageId":"20060726010358.20964.80443.stgit@machine","threadId":"4980","inReplyTo":"Pine.LNX.4.63.0607251809340.29667@wbgn013.biozentrum.uni-wuerzburg.de","subject":"[PATCH] Eliminate Scalar::Util usage from private-Error.pm","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-07-26T01:03:58Z","receivedAt":"2006-07-26T01:03:58Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"We used just the blessed() routine so steal it from Scalar/Util.pm. ;-)\n(Unfortunately, Scalar::Util is not bundled with older Perl versions.)\n\nThis is a newer much saner blessed() version by Randal L. Schwarz.\n\nSigned-off-by: Petr Baudis <pasky@suse.cz>\n---\n\n perl/private-Error.pm |   14 ++++++++++----\n 1 files changed, 10 insertions(+), 4 deletions(-)\n\ndiff --git a/perl/private-Error.pm b/perl/private-Error.pm\nindex ebd0749..8fff866 100644\n--- a/perl/private-Error.pm\n+++ b/perl/private-Error.pm\n@@ -43,8 +43,6 @@ sub throw_Error_Simple\n \n # Exported subs are defined in Error::subs\n \n-use Scalar::Util ();\n-\n sub import {\n     shift;\n     local $Exporter::ExportLevel = $Exporter::ExportLevel + 1;\n@@ -290,6 +288,14 @@ use vars qw(@EXPORT_OK @ISA %EXPORT_TAGS\n \n @ISA = qw(Exporter);\n \n+\n+sub blessed {\n+\tmy $item = shift;\n+\tlocal $@; # don't kill an outer $@\n+\tref $item and eval { $item->can('can') };\n+}\n+\n+\n sub run_clauses ($$$\\@) {\n     my($clauses,$err,$wantarray,$result) = @_;\n     my $code = undef;\n@@ -312,7 +318,7 @@ sub run_clauses ($$$\\@) {\n \t\t    $i -= 2;\n \t\t    next CATCHLOOP;\n \t\t}\n-\t\telsif(Scalar::Util::blessed($err) && $err->isa($pkg)) {\n+\t\telsif(blessed($err) && $err->isa($pkg)) {\n \t\t    $code = $catch->[$i+1];\n \t\t    while(1) {\n \t\t\tmy $more = 0;\n@@ -421,7 +427,7 @@ sub try (&;$) {\n \n     if (defined($err))\n     {\n-        if (Scalar::Util::blessed($err) && $err->can('throw'))\n+        if (blessed($err) && $err->can('throw'))\n         {\n             throw $err;\n         }\n"},{"id":"24113","messageId":"Pine.LNX.4.63.0607260356480.29667@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"4980","inReplyTo":"20060726010358.20964.80443.stgit@machine","subject":"Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-07-26T02:01:03Z","receivedAt":"2006-07-26T02:01:03Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 26 Jul 2006, Petr Baudis wrote:\n\n> We used just the blessed() routine so steal it from Scalar/Util.pm. ;-)\n> (Unfortunately, Scalar::Util is not bundled with older Perl versions.)\n> \n> This is a newer much saner blessed() version by Randal L. Schwarz.\n\nAfter a lot of fiddling, it works here. Remarks:\n\n- It is not at all easy to run git (Perl scripts) in-place. At least for \n  Python, you can set a variable in config.mak and be done with it.\n- private_Error.pm is not used. I had to rename it for Error.pm to be\n  picked up.\n- It even passes t7001 now. _After_ I spent two hours rewriting it in C.\n\nCiao,\nDscho\n"},{"id":"24114","messageId":"Pine.LNX.4.63.0607260402460.29667@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"4980","inReplyTo":"Pine.LNX.4.63.0607260356480.29667@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-07-26T02:03:32Z","receivedAt":"2006-07-26T02:03:32Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 26 Jul 2006, Johannes Schindelin wrote:\n\n> - private_Error.pm is not used. I had to rename it for Error.pm to be\n>   picked up.\n\nNever mind. After I finally got the GITPERLLIB thing right, it did pick \nError.pm up.\n\nCiao,\nDscho\n"},{"id":"24115","messageId":"20060726021058.GV13776@pasky.or.cz","threadId":"4980","inReplyTo":"Pine.LNX.4.63.0607260356480.29667@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-07-26T02:10:58Z","receivedAt":"2006-07-26T02:10:58Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"  Hi,\n\nDear diary, on Wed, Jul 26, 2006 at 04:01:03AM CEST, I got a letter\nwhere Johannes Schindelin <Johannes.Schindelin@gmx.de> said that...\n> After a lot of fiddling, it works here. Remarks:\n\n  thanks for the testing!\n\n> - It is not at all easy to run git (Perl scripts) in-place. At least for \n>   Python, you can set a variable in config.mak and be done with it.\n\n  Does setting prefix to the same directory as where your Git tree is\nhelp?  (If so, we might want to document it.)\n\n> - private_Error.pm is not used. I had to rename it for Error.pm to be\n>   picked up.\n\n  Hmm, yes, I guess it is copied in place only during the installation.\nWe might add something like\n\n\tall:\n\t\tcp private-Error.pm blib/lib/Error.pm\n\nto the perl/Makefile. Opinions?\n\n> - It even passes t7001 now. _After_ I spent two hours rewriting it in C.\n\n  Thanks for the patience - I hope we will finally get all the remaining\nPerl problems sorted out.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nSnow falling on Perl. White noise covering line noise.\nHides all the bugs too. -- J. Putnam\n"},{"id":"24116","messageId":"20060726021145.GW13776@pasky.or.cz","threadId":"4980","inReplyTo":"Pine.LNX.4.63.0607260402460.29667@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-07-26T02:11:45Z","receivedAt":"2006-07-26T02:11:45Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"  Hi,\n\nDear diary, on Wed, Jul 26, 2006 at 04:03:32AM CEST, I got a letter\nwhere Johannes Schindelin <Johannes.Schindelin@gmx.de> said that...\n> On Wed, 26 Jul 2006, Johannes Schindelin wrote:\n> \n> > - private_Error.pm is not used. I had to rename it for Error.pm to be\n> >   picked up.\n> \n> Never mind. After I finally got the GITPERLLIB thing right, it did pick \n> Error.pm up.\n\n  cool. How did you tweak it?\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nSnow falling on Perl. White noise covering line noise.\nHides all the bugs too. -- J. Putnam\n"},{"id":"24117","messageId":"20060726021550.GX13776@pasky.or.cz","threadId":"4980","inReplyTo":"7vhd15cfaj.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-07-26T02:15:50Z","receivedAt":"2006-07-26T02:15:50Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Wed, Jul 26, 2006 at 03:42:44AM CEST, I got a letter\nwhere Junio C Hamano <junkio@cox.net> said that...\n> Petr Baudis <pasky@suse.cz> writes:\n> \n> > diff --git a/perl/private-Error.pm b/perl/private-Error.pm\n> > index ebd0749..8fff866 100644\n> > --- a/perl/private-Error.pm\n> > +++ b/perl/private-Error.pm\n> > @@ -290,6 +288,14 @@ use vars qw(@EXPORT_OK @ISA %EXPORT_TAGS\n> >  \n> >  @ISA = qw(Exporter);\n> >  \n> > +\n> > +sub blessed {\n> > +\tmy $item = shift;\n> > +\tlocal $@; # don't kill an outer $@\n> > +\tref $item and eval { $item->can('can') };\n> > +}\n> \n> Hmmm.  I wonder how this relates to what Merlyn actually said?\n> \n>         From: merlyn@stonehenge.com (Randal L. Schwartz)\n>         Subject: Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm\n>         Date: 10 Jul 2006 18:42:35 -0700\n>         Message-ID: <863bd8nchg.fsf@blue.stonehenge.com>\n>         Cc: Junio C Hamano <junkio@cox.net>, <git@vger.kernel.org>\n>         To: Petr Baudis <pasky@suse.cz>\n> \n>         >>>>> \"Randal\" == Randal L Schwartz <merlyn@stonehenge.com> writes:\n>         Randal> sub blessed {\n>         Randal> my $item = shift;\n>         Randal> local $@; # don't kill an outer $@\n>         Randal> ref $item and eval { $item->can('can') };\n>         Randal> }\n> \n>         Randal> Oops, lose the local $@ line.  Just found out this is a\n>         Randal> broken thing in current Perls.  The rest is good though.\n> \n>         And thirdly, ignore what I *just* said, and concentrate on what\n>         I *previously* said, becaused my testing was off.\n> \n> My reading is that (1) the part of the patch should read\n> something like this:\n> \n>         sub blessed {\n>                 my $item = shift;\n>                 ref $item and eval { $item->can('can') };\n>         }\n\nI don't know, from my late-night understanding it should have the local\nline... :-)\n\n> and (2) Merlyn thinks there is a bigger problem than using Scalar::Util\n> which should be dealt with first.  Was the use of try{}catch{}\n> syntax sugar (and it is easy to leak memory) the issue?  How was\n> that resolved?\n\nWe never got to producing anything that could trigger the memleak, at\nleast I wasn't able to reproduce it based on the rather vague\ndescription.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nSnow falling on Perl. White noise covering line noise.\nHides all the bugs too. -- J. Putnam\n"},{"id":"24118","messageId":"Pine.LNX.4.63.0607260416070.29667@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"4980","inReplyTo":"20060726021058.GV13776@pasky.or.cz","subject":"Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-07-26T02:25:13Z","receivedAt":"2006-07-26T02:25:13Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 26 Jul 2006, Petr Baudis wrote:\n\n>   Hi,\n> \n> Dear diary, on Wed, Jul 26, 2006 at 04:01:03AM CEST, I got a letter\n> where Johannes Schindelin <Johannes.Schindelin@gmx.de> said that...\n> \n> > - It is not at all easy to run git (Perl scripts) in-place. At least for \n> >   Python, you can set a variable in config.mak and be done with it.\n> \n>   Does setting prefix to the same directory as where your Git tree is\n> help?\n\nNope. The culprit is\n\nuse lib (split(/:/, $ENV{GITPERLLIB} || \"/Library/Perl/darwin\"));\n\nThe latter, /Library/Perl/darwin comes from making \"instlibdir\" in perl/, \nwhich in turn is generated by \"perl Makefile.PL\". Calling the latter with \nPREFIX set does not change the output of \"instlibdir\" in any way.\n\n> > - private_Error.pm is not used. I had to rename it for Error.pm to be\n> >   picked up.\n> \n>   Hmm, yes, I guess it is copied in place only during the installation.\n> We might add something like\n> \n> \tall:\n> \t\tcp private-Error.pm blib/lib/Error.pm\n> \n> to the perl/Makefile. Opinions?\n\nThis (from Makefile.PL) is already sufficient:\n\n# We come with our own bundled Error.pm. It's not in the set of default\n# Perl modules so install it if it's not available on the system yet.\neval { require Error };\nif ($@) {\n        $pm{'private-Error.pm'} = '$(INST_LIBDIR)/Error.pm';\n}\n\n> > - It even passes t7001 now. _After_ I spent two hours rewriting it in C.\n> \n>   Thanks for the patience - I hope we will finally get all the remaining\n> Perl problems sorted out.\n\nWhat patience? Ah yes, I understand: irony.\n\nSeriously, I still believe that proof-of-concepts in Bash or Perl or even \nPython are fine. But they are not for real work, so one of my long-term \ngoals for git is to get rid of them.\n\nCiao,\nDscho\n"},{"id":"24119","messageId":"Pine.LNX.4.63.0607260426010.29667@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"4980","inReplyTo":"20060726021145.GW13776@pasky.or.cz","subject":"Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-07-26T02:26:18Z","receivedAt":"2006-07-26T02:26:18Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 26 Jul 2006, Petr Baudis wrote:\n\n> Dear diary, on Wed, Jul 26, 2006 at 04:03:32AM CEST, I got a letter\n> where Johannes Schindelin <Johannes.Schindelin@gmx.de> said that...\n> > On Wed, 26 Jul 2006, Johannes Schindelin wrote:\n> > \n> > > - private_Error.pm is not used. I had to rename it for Error.pm to be\n> > >   picked up.\n> > \n> > Never mind. After I finally got the GITPERLLIB thing right, it did pick \n> > Error.pm up.\n> \n>   cool. How did you tweak it?\n\nI did not. You did. According to 5c4082fd687bd0784d3a4d96550e8afab332b63a.\n\nCiao,\nDscho\n"},{"id":"24127","messageId":"ea7r3s$ta2$1@sea.gmane.org","threadId":"4980","inReplyTo":"Pine.LNX.4.63.0607260416070.29667@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-07-26T13:35:57Z","receivedAt":"2006-07-26T13:35:57Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Johannes Schindelin wrote:\n\n> Seriously, I still believe that proof-of-concepts in Bash or Perl or even \n> Python are fine. But they are not for real work, so one of my long-term \n> goals for git is to get rid of them.\n\nI don't think that we would want to rewrite gitweb in C, for example.\nAnd Perl for porcelanish commands is all right, IMVVHO.\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"24137","messageId":"Pine.LNX.4.63.0607261702500.29667@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"4980","inReplyTo":"ea7r3s$ta2$1@sea.gmane.org","subject":"Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-07-26T15:17:37Z","receivedAt":"2006-07-26T15:17:37Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\n[please do not remove me from the Cc: when replying to my mail]\n\nOn Wed, 26 Jul 2006, Jakub Narebski wrote:\n\n> Johannes Schindelin wrote:\n> \n> > Seriously, I still believe that proof-of-concepts in Bash or Perl or even \n> > Python are fine. But they are not for real work, so one of my long-term \n> > goals for git is to get rid of them.\n> \n> I don't think that we would want to rewrite gitweb in C, for example.\n> And Perl for porcelanish commands is all right, IMVVHO.\n\nThis is true as long as you do not have problems with Perl. As soon as you \nstart having too many problems with Perl, you want to get rid of it as \nsoon as possible.\n\nThink missing modules. Think ActiveState. Think corporate environment. \nThink other platforms. Think having to mix compilers. Or to support \nanother one, because you cannot mix. Etc. etc.\n\nCiao,\nDscho\n"},{"id":"24146","messageId":"20060726175931.37750.qmail@web31810.mail.mud.yahoo.com","threadId":"4980","inReplyTo":"Pine.LNX.4.63.0607261702500.29667@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-07-26T17:59:31Z","receivedAt":"2006-07-26T17:59:31Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"--- Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> Hi,\n> \n> [please do not remove me from the Cc: when replying to my mail]\n> \n> On Wed, 26 Jul 2006, Jakub Narebski wrote:\n> \n> > Johannes Schindelin wrote:\n> > \n> > > Seriously, I still believe that proof-of-concepts in Bash or Perl or even \n> > > Python are fine. But they are not for real work, so one of my long-term \n> > > goals for git is to get rid of them.\n> > \n> > I don't think that we would want to rewrite gitweb in C, for example.\n> > And Perl for porcelanish commands is all right, IMVVHO.\n\nI agree with Jakub.  Both on the deployment side and on the maintenance\nand upkeeping side.  Small and fast engine in C and porcelain in whatever\nmakes sense: Perl, Python, Bash, or even C, etc.\n\n> This is true as long as you do not have problems with Perl. As soon as you \n> start having too many problems with Perl, you want to get rid of it as \n> soon as possible.\n\nThe normal thing to do is to post an email to the mailing list describing\nthe problems you see with Perl, and describing your solution to them, possibly\naccompanied with a patch.  But to just post a \"convert-to-C\" patch is hardly\nconstructive (to the actual problem you had).\n\n> Think missing modules. Think ActiveState. Think corporate environment. \n> Think other platforms. Think having to mix compilers. Or to support \n> another one, because you cannot mix. Etc. etc.\n\nYep, exactly _those_ reasons you outlined, tell me that some things are\n_better_ off staying in Perl/Python/etc.\n\n    Luben\n"},{"id":"24167","messageId":"20060726213409.GY13776@pasky.or.cz","threadId":"4980","inReplyTo":"Pine.LNX.4.63.0607260416070.29667@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-07-26T21:34:09Z","receivedAt":"2006-07-26T21:34:09Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"  Hi!\n\nDear diary, on Wed, Jul 26, 2006 at 04:25:13AM CEST, I got a letter\nwhere Johannes Schindelin <Johannes.Schindelin@gmx.de> said that...\n> Nope. The culprit is\n> \n> use lib (split(/:/, $ENV{GITPERLLIB} || \"/Library/Perl/darwin\"));\n> \n> The latter, /Library/Perl/darwin comes from making \"instlibdir\" in perl/, \n> which in turn is generated by \"perl Makefile.PL\". Calling the latter with \n> PREFIX set does not change the output of \"instlibdir\" in any way.\n\nxpasky@machine[1:0]~/git-pb/perl$ perl Makefile.PL && make instlibdir\nWriting Makefile for Git\n/usr/lib/perl5/site_perl/5.8.8/i686-linux\nxpasky@machine[1:0]~/git-pb/perl$ perl Makefile.PL PREFIX=/home/xpasky && make instlibdir\nWriting Makefile for Git\n/home/xpasky/lib/perl5/site_perl/5.8.8/i686-linux\n\n  But it wouldn't help anyway, you would need to install git \"to\nitself\", which I'm not sure how well works.\n\n  I think in previous discussions it was deemed acceptable to require\nthe user running Git in place to set PERL5LIB so that Git.pm is found.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nSnow falling on Perl. White noise covering line noise.\nHides all the bugs too. -- J. Putnam\n"},{"id":"24198","messageId":"86ejw7b4em.fsf@blue.stonehenge.com","threadId":"4980","inReplyTo":"Pine.LNX.4.63.0607261702500.29667@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm","fromName":"Randal L. Schwartz","fromEmail":"merlyn@stonehenge.com","sentAt":"2006-07-27T12:47:45Z","receivedAt":"2006-07-27T12:47:45Z","isPatch":true,"sender":{"key":"merlyn@stonehenge.com","avatar":"https://gravatar.com/avatar/dc528d210743ff0333e6213f9ee7b33b23f1b7bc1f3c5a8c2d819074ecd7ab19?d=mp&s=160"},"body":">>>>> \"Johannes\" == Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\nJohannes>  Think ActiveState. \n\nThink ActiveState for the last time and see Strawberry Perl instead.\n<http://vanillaperl.com/>.\n\n-- \nRandal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095\n<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>\nPerl/Unix/security consulting, Technical writing, Comedy, etc. etc.\nSee PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!\n"},{"id":"24203","messageId":"Pine.LNX.4.63.0607271559161.29667@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"4980","inReplyTo":"86ejw7b4em.fsf@blue.stonehenge.com","subject":"Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-07-27T14:00:13Z","receivedAt":"2006-07-27T14:00:13Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 27 Jul 2006, Randal L. Schwartz wrote:\n\n> >>>>> \"Johannes\" == Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> Johannes>  Think ActiveState. \n> \n> Think ActiveState for the last time and see Strawberry Perl instead.\n> <http://vanillaperl.com/>.\n\nWishful thinking. If it wasn't for political reasons, certain people would \nuse cygwin's perl already, instead of ActiveState.\n\nCiao,\nDscho\n"},{"id":"24207","messageId":"867j1zb00h.fsf@blue.stonehenge.com","threadId":"4980","inReplyTo":"Pine.LNX.4.63.0607271559161.29667@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm","fromName":"Randal L. Schwartz","fromEmail":"merlyn@stonehenge.com","sentAt":"2006-07-27T14:22:38Z","receivedAt":"2006-07-27T14:22:38Z","isPatch":true,"sender":{"key":"merlyn@stonehenge.com","avatar":"https://gravatar.com/avatar/dc528d210743ff0333e6213f9ee7b33b23f1b7bc1f3c5a8c2d819074ecd7ab19?d=mp&s=160"},"body":">>>>> \"Johannes\" == Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\nJohannes> Wishful thinking. If it wasn't for political reasons, certain people would \nJohannes> use cygwin's perl already, instead of ActiveState.\n\nI don't think this is a \"cygwin\" perl though.  This is released under\nPerl's terms, so it's not just gnu.  It's a complete build system with\na bundled C compiler, running on Windows natively.\n\n-- \nRandal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095\n<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>\nPerl/Unix/security consulting, Technical writing, Comedy, etc. etc.\nSee PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!\n"},{"id":"24208","messageId":"Pine.LNX.4.63.0607271628590.29667@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"4980","inReplyTo":"867j1zb00h.fsf@blue.stonehenge.com","subject":"Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-07-27T14:32:19Z","receivedAt":"2006-07-27T14:32:19Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 27 Jul 2006, Randal L. Schwartz wrote:\n\n> >>>>> \"Johannes\" == Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> Johannes> Wishful thinking. If it wasn't for political reasons, certain people would \n> Johannes> use cygwin's perl already, instead of ActiveState.\n> \n> I don't think this is a \"cygwin\" perl though.  This is released under\n> Perl's terms, so it's not just gnu.  It's a complete build system with\n> a bundled C compiler, running on Windows natively.\n\nWhat free people rarely think about: Windows has a severe path problem. It \nis not the only problem of Windows, but a very real, and very annoying \none. Nobody in her right mind would try to make \":\" part of a path, let \nalone \";\" part of the $PATH!\n\nSo I think it is still better to use cygwin's perl, not ActiveState, or \neven Strawberry (which ice cream addict came up with _that_ one?).\n\nAt least, it is better, _if_ you have a choice.\n\nCiao,\nDscho\n"}]}