git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cvsserver: avoid warning about active db handles
@ 2006-07-25 11:57 Johannes Schindelin
  2006-07-25 12:07 ` Martin Langhoff (CatalystIT)
  0 siblings, 1 reply; 21+ messages in thread
From: Johannes Schindelin @ 2006-07-25 11:57 UTC (permalink / raw)
  To: git, Martin Langhoff (CatalystIT), junkio


Turns out that DBD::SQLite does not favour preparing statements which are
never executed. So, turn all 4 statements, which were prepared _always_,
into methods, like the other 12 prepared statements.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
	Now, the only warning left is the gzip one...

 git-cvsserver.perl |   70 ++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 56 insertions(+), 14 deletions(-)

diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 981b6ba..b2837ad 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -2131,12 +2131,6 @@ sub update
     # first lets get the commit list
     $ENV{GIT_DIR} = $self->{git_path};
 
-    # prepare database queries
-    my $db_insert_rev = $self->{dbh}->prepare_cached("INSERT INTO revision (name, revision, filehash, commithash, modified, author, mode) VALUES (?,?,?,?,?,?,?)",{},1);
-    my $db_insert_mergelog = $self->{dbh}->prepare_cached("INSERT INTO commitmsgs (key, value) VALUES (?,?)",{},1);
-    my $db_delete_head = $self->{dbh}->prepare_cached("DELETE FROM head",{},1);
-    my $db_insert_head = $self->{dbh}->prepare_cached("INSERT INTO head (name, revision, filehash, commithash, modified, author, mode) VALUES (?,?,?,?,?,?,?)",{},1);
-
     my $commitinfo = `git-cat-file commit $self->{module} 2>&1`;
     unless ( $commitinfo =~ /tree\s+[a-zA-Z0-9]{40}/ )
     {
@@ -2325,7 +2319,7 @@ sub update
                         author => $commit->{author},
                         mode => $git_perms,
                     };
-                    $db_insert_rev->execute($4, $head->{$4}{revision}, $2, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
+                    $self->insert_rev($4, $head->{$4}{revision}, $2, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
                 }
                 elsif ( $3 eq "M" )
                 {
@@ -2339,7 +2333,7 @@ sub update
                         author => $commit->{author},
                         mode => $git_perms,
                     };
-                    $db_insert_rev->execute($4, $head->{$4}{revision}, $2, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
+                    $self->insert_rev($4, $head->{$4}{revision}, $2, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
                 }
                 elsif ( $3 eq "A" )
                 {
@@ -2353,7 +2347,7 @@ sub update
                         author => $commit->{author},
                         mode => $git_perms,
                     };
-                    $db_insert_rev->execute($4, $head->{$4}{revision}, $2, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
+                    $self->insert_rev($4, $head->{$4}{revision}, $2, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
                 }
                 else
                 {
@@ -2410,7 +2404,7 @@ sub update
                     };
 
 
-                    $db_insert_rev->execute($git_filename, $newrevision, $git_hash, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
+                    $self->insert_rev($git_filename, $newrevision, $git_hash, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
                 }
             }
             close FILELIST;
@@ -2426,7 +2420,7 @@ sub update
                     $head->{$file}{modified} = $commit->{date};
                     $head->{$file}{author} = $commit->{author};
 
-                    $db_insert_rev->execute($file, $head->{$file}{revision}, $head->{$file}{filehash}, $commit->{hash}, $commit->{date}, $commit->{author}, $head->{$file}{mode});
+                    $self->insert_rev($file, $head->{$file}{revision}, $head->{$file}{filehash}, $commit->{hash}, $commit->{date}, $commit->{author}, $head->{$file}{mode});
                 }
             }
             # END : "Detect deleted files"
@@ -2435,7 +2429,7 @@ sub update
 
         if (exists $commit->{mergemsg})
         {
-            $db_insert_mergelog->execute($commit->{hash}, $commit->{mergemsg});
+            $self->insert_mergelog($commit->{hash}, $commit->{mergemsg});
         }
 
         $lastpicked = $commit->{hash};
@@ -2443,10 +2437,10 @@ sub update
         $self->_set_prop("last_commit", $commit->{hash});
     }
 
-    $db_delete_head->execute();
+    $self->delete_head();
     foreach my $file ( keys %$head )
     {
-        $db_insert_head->execute(
+        $self->insert_head(
             $file,
             $head->{$file}{revision},
             $head->{$file}{filehash},
@@ -2464,6 +2458,54 @@ sub update
     $self->{dbh}->commit() or die "Failed to commit changes to SQLite";
 }
 
+sub insert_rev
+{
+    my $self = shift;
+    my $name = shift;
+    my $revision = shift;
+    my $filehash = shift;
+    my $commithash = shift;
+    my $modified = shift;
+    my $author = shift;
+    my $mode = shift;
+
+    my $insert_rev = $self->{dbh}->prepare_cached("INSERT INTO revision (name, revision, filehash, commithash, modified, author, mode) VALUES (?,?,?,?,?,?,?)",{},1);
+    $insert_rev->execute($name, $revision, $filehash, $commithash, $modified, $author, $mode);
+}
+
+sub insert_mergelog
+{
+    my $self = shift;
+    my $key = shift;
+    my $value = shift;
+
+    my $insert_mergelog = $self->{dbh}->prepare_cached("INSERT INTO commitmsgs (key, value) VALUES (?,?)",{},1);
+    $insert_mergelog->execute($key, $value);
+}
+
+sub delete_head
+{
+    my $self = shift;
+
+    my $delete_head = $self->{dbh}->prepare_cached("DELETE FROM head",{},1);
+    $delete_head->execute();
+}
+
+sub insert_head
+{
+    my $self = shift;
+    my $name = shift;
+    my $revision = shift;
+    my $filehash = shift;
+    my $commithash = shift;
+    my $modified = shift;
+    my $author = shift;
+    my $mode = shift;
+
+    my $insert_head = $self->{dbh}->prepare_cached("INSERT INTO head (name, revision, filehash, commithash, modified, author, mode) VALUES (?,?,?,?,?,?,?)",{},1);
+    $insert_head->execute($name, $revision, $filehash, $commithash, $modified, $author, $mode);
+}
+
 sub _headrev
 {
     my $self = shift;
-- 
1.4.2.rc1.gd3c5-dirty

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH] cvsserver: avoid warning about active db handles
  2006-07-25 11:57 [PATCH] cvsserver: avoid warning about active db handles Johannes Schindelin
@ 2006-07-25 12:07 ` Martin Langhoff (CatalystIT)
  2006-07-25 14:53   ` Johannes Schindelin
  0 siblings, 1 reply; 21+ messages in thread
From: Martin Langhoff (CatalystIT) @ 2006-07-25 12:07 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git, junkio

Johannes Schindelin wrote:

> Turns out that DBD::SQLite does not favour preparing statements which are
> never executed. So, turn all 4 statements, which were prepared _always_,
> into methods, like the other 12 prepared statements.

Can you give me a reference for that "does not favour preparing 
statements"? I have some vague recollection of timing 
prepared/unprepared inserts and getting a huge difference in 
performance. Looking at the source of SQLite.pm doesn't clarify much -- 
prepare_cached is actually implemented by DBI, the driver doesn't need 
to implement it. Anyway, I guess it has to do with the cost of preparing 
it in the lower level driver anyway.


> 	Now, the only warning left is the gzip one...

That's harder. I wonder whether using libgit's XS module we can now get 
libgit to give us a gzipped file directly. I guess it only has 
performance savings for unpacked repos.

cheers,


martin
-- 
-----------------------------------------------------------------------
Martin @ Catalyst .Net .NZ  Ltd, PO Box 11-053, Manners St,  Wellington
WEB: http://catalyst.net.nz/           PHYS: Level 2, 150-154 Willis St
OFFICE: +64(4)916-7224                              MOB: +64(21)364-017
       Make things as simple as possible, but no simpler - Einstein
-----------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] cvsserver: avoid warning about active db handles
  2006-07-25 12:07 ` Martin Langhoff (CatalystIT)
@ 2006-07-25 14:53   ` Johannes Schindelin
  2006-07-25 15:52     ` Petr Baudis
  0 siblings, 1 reply; 21+ messages in thread
From: Johannes Schindelin @ 2006-07-25 14:53 UTC (permalink / raw)
  To: Martin Langhoff (CatalystIT); +Cc: git, junkio

Hi,

[sorry for the delay... darn meetings]

On Wed, 26 Jul 2006, Martin Langhoff (CatalystIT) wrote:

> Johannes Schindelin wrote:
> 
> > Turns out that DBD::SQLite does not favour preparing statements which 
> > are never executed. So, turn all 4 statements, which were prepared 
> > _always_, into methods, like the other 12 prepared statements.
> 
> Can you give me a reference for that "does not favour preparing 
> statements"?

The relevant bug entry is

	http://rt.cpan.org/Public/Bug/Display.html?id=17603

> I have some vague recollection of timing prepared/unprepared inserts and 
> getting a huge difference in performance.

Yes, preparing before executing is a wonderful thing. But you need to 
execute the prepared statements; otherwise it is a waste of resources 
(plus, it does not finalize with DBD::SQLite).

> Looking at the source of SQLite.pm doesn't clarify much -- 
> prepare_cached is actually implemented by DBI, the driver doesn't need 
> to implement it.

Yes. The culprit is in prepare().

> > 	Now, the only warning left is the gzip one...
> 
> That's harder. I wonder whether using libgit's XS module we can now get 
> libgit to give us a gzipped file directly. I guess it only has 
> performance savings for unpacked repos.

I still have the problem on at least two of my boxes that Git.xs does not 
load. The next thing after looking into the gzip thing is to rewrite 
git-mv in C.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] cvsserver: avoid warning about active db handles
  2006-07-25 14:53   ` Johannes Schindelin
@ 2006-07-25 15:52     ` Petr Baudis
  2006-07-25 16:10       ` Git.xs problem, was " Johannes Schindelin
  0 siblings, 1 reply; 21+ messages in thread
From: Petr Baudis @ 2006-07-25 15:52 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Martin Langhoff (CatalystIT), git, junkio

  Hi,

Dear diary, on Tue, Jul 25, 2006 at 04:53:16PM CEST, I got a letter
where Johannes Schindelin <Johannes.Schindelin@gmx.de> said that...
> > That's harder. I wonder whether using libgit's XS module we can now get 
> > libgit to give us a gzipped file directly. I guess it only has 
> > performance savings for unpacked repos.

  the object in the database is compressed together with the header, so
we have to recompress it anyway.

> I still have the problem on at least two of my boxes that Git.xs does not 
> load.

  What is the problem? I must have overlooked it, sorry. :-(

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Snow falling on Perl. White noise covering line noise.
Hides all the bugs too. -- J. Putnam

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Git.xs problem, was Re: [PATCH] cvsserver: avoid warning about active db handles
  2006-07-25 15:52     ` Petr Baudis
@ 2006-07-25 16:10       ` Johannes Schindelin
  2006-07-26  1:03         ` [PATCH] Eliminate Scalar::Util usage from private-Error.pm Petr Baudis
  0 siblings, 1 reply; 21+ messages in thread
From: Johannes Schindelin @ 2006-07-25 16:10 UTC (permalink / raw)
  To: Petr Baudis; +Cc: Martin Langhoff (CatalystIT), git, junkio

Hi,

On Tue, 25 Jul 2006, Petr Baudis wrote:

>   Hi,
> 
> Dear diary, on Tue, Jul 25, 2006 at 04:53:16PM CEST, I got a letter
> where Johannes Schindelin <Johannes.Schindelin@gmx.de> said that...
> 
> > I still have the problem on at least two of my boxes that Git.xs does not 
> > load.
> 
>   What is the problem? I must have overlooked it, sorry. :-(

Still that darn private_Error.pm thing requiring Scalar::Util, IIRC.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH] Eliminate Scalar::Util usage from private-Error.pm
  2006-07-25 16:10       ` Git.xs problem, was " Johannes Schindelin
@ 2006-07-26  1:03         ` Petr Baudis
  2006-07-26  2:01           ` Johannes Schindelin
       [not found]           ` <7vhd15cfaj.fsf@assigned-by-dhcp.cox.net>
  0 siblings, 2 replies; 21+ messages in thread
From: Petr Baudis @ 2006-07-26  1:03 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

We used just the blessed() routine so steal it from Scalar/Util.pm. ;-)
(Unfortunately, Scalar::Util is not bundled with older Perl versions.)

This is a newer much saner blessed() version by Randal L. Schwarz.

Signed-off-by: Petr Baudis <pasky@suse.cz>
---

 perl/private-Error.pm |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/perl/private-Error.pm b/perl/private-Error.pm
index ebd0749..8fff866 100644
--- a/perl/private-Error.pm
+++ b/perl/private-Error.pm
@@ -43,8 +43,6 @@ sub throw_Error_Simple
 
 # Exported subs are defined in Error::subs
 
-use Scalar::Util ();
-
 sub import {
     shift;
     local $Exporter::ExportLevel = $Exporter::ExportLevel + 1;
@@ -290,6 +288,14 @@ use vars qw(@EXPORT_OK @ISA %EXPORT_TAGS
 
 @ISA = qw(Exporter);
 
+
+sub blessed {
+	my $item = shift;
+	local $@; # don't kill an outer $@
+	ref $item and eval { $item->can('can') };
+}
+
+
 sub run_clauses ($$$\@) {
     my($clauses,$err,$wantarray,$result) = @_;
     my $code = undef;
@@ -312,7 +318,7 @@ sub run_clauses ($$$\@) {
 		    $i -= 2;
 		    next CATCHLOOP;
 		}
-		elsif(Scalar::Util::blessed($err) && $err->isa($pkg)) {
+		elsif(blessed($err) && $err->isa($pkg)) {
 		    $code = $catch->[$i+1];
 		    while(1) {
 			my $more = 0;
@@ -421,7 +427,7 @@ sub try (&;$) {
 
     if (defined($err))
     {
-        if (Scalar::Util::blessed($err) && $err->can('throw'))
+        if (blessed($err) && $err->can('throw'))
         {
             throw $err;
         }

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm
  2006-07-26  1:03         ` [PATCH] Eliminate Scalar::Util usage from private-Error.pm Petr Baudis
@ 2006-07-26  2:01           ` Johannes Schindelin
  2006-07-26  2:03             ` Johannes Schindelin
  2006-07-26  2:10             ` Petr Baudis
       [not found]           ` <7vhd15cfaj.fsf@assigned-by-dhcp.cox.net>
  1 sibling, 2 replies; 21+ messages in thread
From: Johannes Schindelin @ 2006-07-26  2:01 UTC (permalink / raw)
  To: Petr Baudis; +Cc: Junio C Hamano, git

Hi,

On Wed, 26 Jul 2006, Petr Baudis wrote:

> We used just the blessed() routine so steal it from Scalar/Util.pm. ;-)
> (Unfortunately, Scalar::Util is not bundled with older Perl versions.)
> 
> This is a newer much saner blessed() version by Randal L. Schwarz.

After a lot of fiddling, it works here. Remarks:

- It is not at all easy to run git (Perl scripts) in-place. At least for 
  Python, you can set a variable in config.mak and be done with it.
- private_Error.pm is not used. I had to rename it for Error.pm to be
  picked up.
- It even passes t7001 now. _After_ I spent two hours rewriting it in C.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm
  2006-07-26  2:01           ` Johannes Schindelin
@ 2006-07-26  2:03             ` Johannes Schindelin
  2006-07-26  2:11               ` Petr Baudis
  2006-07-26  2:10             ` Petr Baudis
  1 sibling, 1 reply; 21+ messages in thread
From: Johannes Schindelin @ 2006-07-26  2:03 UTC (permalink / raw)
  To: Petr Baudis; +Cc: Junio C Hamano, git

Hi,

On Wed, 26 Jul 2006, Johannes Schindelin wrote:

> - private_Error.pm is not used. I had to rename it for Error.pm to be
>   picked up.

Never mind. After I finally got the GITPERLLIB thing right, it did pick 
Error.pm up.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm
  2006-07-26  2:01           ` Johannes Schindelin
  2006-07-26  2:03             ` Johannes Schindelin
@ 2006-07-26  2:10             ` Petr Baudis
  2006-07-26  2:25               ` Johannes Schindelin
  1 sibling, 1 reply; 21+ messages in thread
From: Petr Baudis @ 2006-07-26  2:10 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Junio C Hamano, git

  Hi,

Dear diary, on Wed, Jul 26, 2006 at 04:01:03AM CEST, I got a letter
where Johannes Schindelin <Johannes.Schindelin@gmx.de> said that...
> After a lot of fiddling, it works here. Remarks:

  thanks for the testing!

> - It is not at all easy to run git (Perl scripts) in-place. At least for 
>   Python, you can set a variable in config.mak and be done with it.

  Does setting prefix to the same directory as where your Git tree is
help?  (If so, we might want to document it.)

> - private_Error.pm is not used. I had to rename it for Error.pm to be
>   picked up.

  Hmm, yes, I guess it is copied in place only during the installation.
We might add something like

	all:
		cp private-Error.pm blib/lib/Error.pm

to the perl/Makefile. Opinions?

> - It even passes t7001 now. _After_ I spent two hours rewriting it in C.

  Thanks for the patience - I hope we will finally get all the remaining
Perl problems sorted out.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Snow falling on Perl. White noise covering line noise.
Hides all the bugs too. -- J. Putnam

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm
  2006-07-26  2:03             ` Johannes Schindelin
@ 2006-07-26  2:11               ` Petr Baudis
  2006-07-26  2:26                 ` Johannes Schindelin
  0 siblings, 1 reply; 21+ messages in thread
From: Petr Baudis @ 2006-07-26  2:11 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Junio C Hamano, git

  Hi,

Dear diary, on Wed, Jul 26, 2006 at 04:03:32AM CEST, I got a letter
where Johannes Schindelin <Johannes.Schindelin@gmx.de> said that...
> On Wed, 26 Jul 2006, Johannes Schindelin wrote:
> 
> > - private_Error.pm is not used. I had to rename it for Error.pm to be
> >   picked up.
> 
> Never mind. After I finally got the GITPERLLIB thing right, it did pick 
> Error.pm up.

  cool. How did you tweak it?

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Snow falling on Perl. White noise covering line noise.
Hides all the bugs too. -- J. Putnam

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm
       [not found]           ` <7vhd15cfaj.fsf@assigned-by-dhcp.cox.net>
@ 2006-07-26  2:15             ` Petr Baudis
  0 siblings, 0 replies; 21+ messages in thread
From: Petr Baudis @ 2006-07-26  2:15 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Randal L.Schwartz

Dear diary, on Wed, Jul 26, 2006 at 03:42:44AM CEST, I got a letter
where Junio C Hamano <junkio@cox.net> said that...
> Petr Baudis <pasky@suse.cz> writes:
> 
> > diff --git a/perl/private-Error.pm b/perl/private-Error.pm
> > index ebd0749..8fff866 100644
> > --- a/perl/private-Error.pm
> > +++ b/perl/private-Error.pm
> > @@ -290,6 +288,14 @@ use vars qw(@EXPORT_OK @ISA %EXPORT_TAGS
> >  
> >  @ISA = qw(Exporter);
> >  
> > +
> > +sub blessed {
> > +	my $item = shift;
> > +	local $@; # don't kill an outer $@
> > +	ref $item and eval { $item->can('can') };
> > +}
> 
> Hmmm.  I wonder how this relates to what Merlyn actually said?
> 
>         From: merlyn@stonehenge.com (Randal L. Schwartz)
>         Subject: Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm
>         Date: 10 Jul 2006 18:42:35 -0700
>         Message-ID: <863bd8nchg.fsf@blue.stonehenge.com>
>         Cc: Junio C Hamano <junkio@cox.net>, <git@vger.kernel.org>
>         To: Petr Baudis <pasky@suse.cz>
> 
>         >>>>> "Randal" == Randal L Schwartz <merlyn@stonehenge.com> writes:
>         Randal> sub blessed {
>         Randal> my $item = shift;
>         Randal> local $@; # don't kill an outer $@
>         Randal> ref $item and eval { $item->can('can') };
>         Randal> }
> 
>         Randal> Oops, lose the local $@ line.  Just found out this is a
>         Randal> broken thing in current Perls.  The rest is good though.
> 
>         And thirdly, ignore what I *just* said, and concentrate on what
>         I *previously* said, becaused my testing was off.
> 
> My reading is that (1) the part of the patch should read
> something like this:
> 
>         sub blessed {
>                 my $item = shift;
>                 ref $item and eval { $item->can('can') };
>         }

I don't know, from my late-night understanding it should have the local
line... :-)

> and (2) Merlyn thinks there is a bigger problem than using Scalar::Util
> which should be dealt with first.  Was the use of try{}catch{}
> syntax sugar (and it is easy to leak memory) the issue?  How was
> that resolved?

We never got to producing anything that could trigger the memleak, at
least I wasn't able to reproduce it based on the rather vague
description.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Snow falling on Perl. White noise covering line noise.
Hides all the bugs too. -- J. Putnam

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm
  2006-07-26  2:10             ` Petr Baudis
@ 2006-07-26  2:25               ` Johannes Schindelin
  2006-07-26 13:35                 ` Jakub Narebski
  2006-07-26 21:34                 ` Petr Baudis
  0 siblings, 2 replies; 21+ messages in thread
From: Johannes Schindelin @ 2006-07-26  2:25 UTC (permalink / raw)
  To: Petr Baudis; +Cc: Junio C Hamano, git

Hi,

On Wed, 26 Jul 2006, Petr Baudis wrote:

>   Hi,
> 
> Dear diary, on Wed, Jul 26, 2006 at 04:01:03AM CEST, I got a letter
> where Johannes Schindelin <Johannes.Schindelin@gmx.de> said that...
> 
> > - It is not at all easy to run git (Perl scripts) in-place. At least for 
> >   Python, you can set a variable in config.mak and be done with it.
> 
>   Does setting prefix to the same directory as where your Git tree is
> help?

Nope. The culprit is

use lib (split(/:/, $ENV{GITPERLLIB} || "/Library/Perl/darwin"));

The latter, /Library/Perl/darwin comes from making "instlibdir" in perl/, 
which in turn is generated by "perl Makefile.PL". Calling the latter with 
PREFIX set does not change the output of "instlibdir" in any way.

> > - private_Error.pm is not used. I had to rename it for Error.pm to be
> >   picked up.
> 
>   Hmm, yes, I guess it is copied in place only during the installation.
> We might add something like
> 
> 	all:
> 		cp private-Error.pm blib/lib/Error.pm
> 
> to the perl/Makefile. Opinions?

This (from Makefile.PL) is already sufficient:

# We come with our own bundled Error.pm. It's not in the set of default
# Perl modules so install it if it's not available on the system yet.
eval { require Error };
if ($@) {
        $pm{'private-Error.pm'} = '$(INST_LIBDIR)/Error.pm';
}

> > - It even passes t7001 now. _After_ I spent two hours rewriting it in C.
> 
>   Thanks for the patience - I hope we will finally get all the remaining
> Perl problems sorted out.

What patience? Ah yes, I understand: irony.

Seriously, I still believe that proof-of-concepts in Bash or Perl or even 
Python are fine. But they are not for real work, so one of my long-term 
goals for git is to get rid of them.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm
  2006-07-26  2:11               ` Petr Baudis
@ 2006-07-26  2:26                 ` Johannes Schindelin
  0 siblings, 0 replies; 21+ messages in thread
From: Johannes Schindelin @ 2006-07-26  2:26 UTC (permalink / raw)
  To: Petr Baudis; +Cc: Junio C Hamano, git

Hi,

On Wed, 26 Jul 2006, Petr Baudis wrote:

> Dear diary, on Wed, Jul 26, 2006 at 04:03:32AM CEST, I got a letter
> where Johannes Schindelin <Johannes.Schindelin@gmx.de> said that...
> > On Wed, 26 Jul 2006, Johannes Schindelin wrote:
> > 
> > > - private_Error.pm is not used. I had to rename it for Error.pm to be
> > >   picked up.
> > 
> > Never mind. After I finally got the GITPERLLIB thing right, it did pick 
> > Error.pm up.
> 
>   cool. How did you tweak it?

I did not. You did. According to 5c4082fd687bd0784d3a4d96550e8afab332b63a.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm
  2006-07-26  2:25               ` Johannes Schindelin
@ 2006-07-26 13:35                 ` Jakub Narebski
  2006-07-26 15:17                   ` Johannes Schindelin
  2006-07-26 21:34                 ` Petr Baudis
  1 sibling, 1 reply; 21+ messages in thread
From: Jakub Narebski @ 2006-07-26 13:35 UTC (permalink / raw)
  To: git

Johannes Schindelin wrote:

> Seriously, I still believe that proof-of-concepts in Bash or Perl or even 
> Python are fine. But they are not for real work, so one of my long-term 
> goals for git is to get rid of them.

I don't think that we would want to rewrite gitweb in C, for example.
And Perl for porcelanish commands is all right, IMVVHO.

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm
  2006-07-26 13:35                 ` Jakub Narebski
@ 2006-07-26 15:17                   ` Johannes Schindelin
  2006-07-26 17:59                     ` Luben Tuikov
  2006-07-27 12:47                     ` Randal L. Schwartz
  0 siblings, 2 replies; 21+ messages in thread
From: Johannes Schindelin @ 2006-07-26 15:17 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git

Hi,

[please do not remove me from the Cc: when replying to my mail]

On Wed, 26 Jul 2006, Jakub Narebski wrote:

> Johannes Schindelin wrote:
> 
> > Seriously, I still believe that proof-of-concepts in Bash or Perl or even 
> > Python are fine. But they are not for real work, so one of my long-term 
> > goals for git is to get rid of them.
> 
> I don't think that we would want to rewrite gitweb in C, for example.
> And Perl for porcelanish commands is all right, IMVVHO.

This is true as long as you do not have problems with Perl. As soon as you 
start having too many problems with Perl, you want to get rid of it as 
soon as possible.

Think missing modules. Think ActiveState. Think corporate environment. 
Think other platforms. Think having to mix compilers. Or to support 
another one, because you cannot mix. Etc. etc.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm
  2006-07-26 15:17                   ` Johannes Schindelin
@ 2006-07-26 17:59                     ` Luben Tuikov
  2006-07-27 12:47                     ` Randal L. Schwartz
  1 sibling, 0 replies; 21+ messages in thread
From: Luben Tuikov @ 2006-07-26 17:59 UTC (permalink / raw)
  To: Johannes Schindelin, Jakub Narebski; +Cc: git

--- Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> Hi,
> 
> [please do not remove me from the Cc: when replying to my mail]
> 
> On Wed, 26 Jul 2006, Jakub Narebski wrote:
> 
> > Johannes Schindelin wrote:
> > 
> > > Seriously, I still believe that proof-of-concepts in Bash or Perl or even 
> > > Python are fine. But they are not for real work, so one of my long-term 
> > > goals for git is to get rid of them.
> > 
> > I don't think that we would want to rewrite gitweb in C, for example.
> > And Perl for porcelanish commands is all right, IMVVHO.

I agree with Jakub.  Both on the deployment side and on the maintenance
and upkeeping side.  Small and fast engine in C and porcelain in whatever
makes sense: Perl, Python, Bash, or even C, etc.

> This is true as long as you do not have problems with Perl. As soon as you 
> start having too many problems with Perl, you want to get rid of it as 
> soon as possible.

The normal thing to do is to post an email to the mailing list describing
the problems you see with Perl, and describing your solution to them, possibly
accompanied with a patch.  But to just post a "convert-to-C" patch is hardly
constructive (to the actual problem you had).

> Think missing modules. Think ActiveState. Think corporate environment. 
> Think other platforms. Think having to mix compilers. Or to support 
> another one, because you cannot mix. Etc. etc.

Yep, exactly _those_ reasons you outlined, tell me that some things are
_better_ off staying in Perl/Python/etc.

    Luben

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm
  2006-07-26  2:25               ` Johannes Schindelin
  2006-07-26 13:35                 ` Jakub Narebski
@ 2006-07-26 21:34                 ` Petr Baudis
  1 sibling, 0 replies; 21+ messages in thread
From: Petr Baudis @ 2006-07-26 21:34 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Junio C Hamano, git

  Hi!

Dear diary, on Wed, Jul 26, 2006 at 04:25:13AM CEST, I got a letter
where Johannes Schindelin <Johannes.Schindelin@gmx.de> said that...
> Nope. The culprit is
> 
> use lib (split(/:/, $ENV{GITPERLLIB} || "/Library/Perl/darwin"));
> 
> The latter, /Library/Perl/darwin comes from making "instlibdir" in perl/, 
> which in turn is generated by "perl Makefile.PL". Calling the latter with 
> PREFIX set does not change the output of "instlibdir" in any way.

xpasky@machine[1:0]~/git-pb/perl$ perl Makefile.PL && make instlibdir
Writing Makefile for Git
/usr/lib/perl5/site_perl/5.8.8/i686-linux
xpasky@machine[1:0]~/git-pb/perl$ perl Makefile.PL PREFIX=/home/xpasky && make instlibdir
Writing Makefile for Git
/home/xpasky/lib/perl5/site_perl/5.8.8/i686-linux

  But it wouldn't help anyway, you would need to install git "to
itself", which I'm not sure how well works.

  I think in previous discussions it was deemed acceptable to require
the user running Git in place to set PERL5LIB so that Git.pm is found.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Snow falling on Perl. White noise covering line noise.
Hides all the bugs too. -- J. Putnam

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm
  2006-07-26 15:17                   ` Johannes Schindelin
  2006-07-26 17:59                     ` Luben Tuikov
@ 2006-07-27 12:47                     ` Randal L. Schwartz
  2006-07-27 14:00                       ` Johannes Schindelin
  1 sibling, 1 reply; 21+ messages in thread
From: Randal L. Schwartz @ 2006-07-27 12:47 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Jakub Narebski, git

>>>>> "Johannes" == Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

Johannes>  Think ActiveState. 

Think ActiveState for the last time and see Strawberry Perl instead.
<http://vanillaperl.com/>.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm
  2006-07-27 12:47                     ` Randal L. Schwartz
@ 2006-07-27 14:00                       ` Johannes Schindelin
  2006-07-27 14:22                         ` Randal L. Schwartz
  0 siblings, 1 reply; 21+ messages in thread
From: Johannes Schindelin @ 2006-07-27 14:00 UTC (permalink / raw)
  To: Randal L. Schwartz; +Cc: Jakub Narebski, git

Hi,

On Thu, 27 Jul 2006, Randal L. Schwartz wrote:

> >>>>> "Johannes" == Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> Johannes>  Think ActiveState. 
> 
> Think ActiveState for the last time and see Strawberry Perl instead.
> <http://vanillaperl.com/>.

Wishful thinking. If it wasn't for political reasons, certain people would 
use cygwin's perl already, instead of ActiveState.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm
  2006-07-27 14:00                       ` Johannes Schindelin
@ 2006-07-27 14:22                         ` Randal L. Schwartz
  2006-07-27 14:32                           ` Johannes Schindelin
  0 siblings, 1 reply; 21+ messages in thread
From: Randal L. Schwartz @ 2006-07-27 14:22 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Jakub Narebski, git

>>>>> "Johannes" == Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

Johannes> Wishful thinking. If it wasn't for political reasons, certain people would 
Johannes> use cygwin's perl already, instead of ActiveState.

I don't think this is a "cygwin" perl though.  This is released under
Perl's terms, so it's not just gnu.  It's a complete build system with
a bundled C compiler, running on Windows natively.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm
  2006-07-27 14:22                         ` Randal L. Schwartz
@ 2006-07-27 14:32                           ` Johannes Schindelin
  0 siblings, 0 replies; 21+ messages in thread
From: Johannes Schindelin @ 2006-07-27 14:32 UTC (permalink / raw)
  To: Randal L. Schwartz; +Cc: Jakub Narebski, git

Hi,

On Thu, 27 Jul 2006, Randal L. Schwartz wrote:

> >>>>> "Johannes" == Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> Johannes> Wishful thinking. If it wasn't for political reasons, certain people would 
> Johannes> use cygwin's perl already, instead of ActiveState.
> 
> I don't think this is a "cygwin" perl though.  This is released under
> Perl's terms, so it's not just gnu.  It's a complete build system with
> a bundled C compiler, running on Windows natively.

What free people rarely think about: Windows has a severe path problem. It 
is not the only problem of Windows, but a very real, and very annoying 
one. Nobody in her right mind would try to make ":" part of a path, let 
alone ";" part of the $PATH!

So I think it is still better to use cygwin's perl, not ActiveState, or 
even Strawberry (which ice cream addict came up with _that_ one?).

At least, it is better, _if_ you have a choice.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2006-07-27 14:32 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-25 11:57 [PATCH] cvsserver: avoid warning about active db handles Johannes Schindelin
2006-07-25 12:07 ` Martin Langhoff (CatalystIT)
2006-07-25 14:53   ` Johannes Schindelin
2006-07-25 15:52     ` Petr Baudis
2006-07-25 16:10       ` Git.xs problem, was " Johannes Schindelin
2006-07-26  1:03         ` [PATCH] Eliminate Scalar::Util usage from private-Error.pm Petr Baudis
2006-07-26  2:01           ` Johannes Schindelin
2006-07-26  2:03             ` Johannes Schindelin
2006-07-26  2:11               ` Petr Baudis
2006-07-26  2:26                 ` Johannes Schindelin
2006-07-26  2:10             ` Petr Baudis
2006-07-26  2:25               ` Johannes Schindelin
2006-07-26 13:35                 ` Jakub Narebski
2006-07-26 15:17                   ` Johannes Schindelin
2006-07-26 17:59                     ` Luben Tuikov
2006-07-27 12:47                     ` Randal L. Schwartz
2006-07-27 14:00                       ` Johannes Schindelin
2006-07-27 14:22                         ` Randal L. Schwartz
2006-07-27 14:32                           ` Johannes Schindelin
2006-07-26 21:34                 ` Petr Baudis
     [not found]           ` <7vhd15cfaj.fsf@assigned-by-dhcp.cox.net>
2006-07-26  2:15             ` Petr Baudis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).