git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Quick merge status updates.
@ 2006-06-28  0:23   ` Junio C Hamano
  2006-06-28  5:04     ` Pavel Roskin
  2006-06-28  7:32     ` Johannes Schindelin
  0 siblings, 2 replies; 27+ messages in thread
From: Junio C Hamano @ 2006-06-28  0:23 UTC (permalink / raw)
  To: git

I'm planning to do 1.4.1 soonish from what's currently in "next"
(fixes already in "master" plus format-patch updates and some
more tests).  I am waiting for a confirmation that Johannes's
cvsimport fix posted earlier on the list does work, or maybe
Martin would come up with an alternative.  I think then we are
good for a release.

Immediately after 1.4.1 happens, I would like to pull in
"Git.xs/Git.pm" series by Pasky into "next".  After that settles
I'd pull in the diff options rewrite by Timo.

For some time, "pu" was left in the state that does not to pass
the testsuite, but I've fixed what's minimally needed (the
breakage was mostly from the diff options rewrite).  People who
regularly follow "next" on platforms other than i386 or x86-64
Linux might want to try out tonight's "pu" to make sure
"Git.xs/Git.pm" series works on their box before it hits "next".
Breakage there would stop your "git pull" working, so this is
somewhat important.

Thanks.

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

* Re: Quick merge status updates.
  2006-06-28  0:23   ` Quick merge status updates Junio C Hamano
@ 2006-06-28  5:04     ` Pavel Roskin
  2006-06-28  8:49       ` Junio C Hamano
  2006-06-28  7:32     ` Johannes Schindelin
  1 sibling, 1 reply; 27+ messages in thread
From: Pavel Roskin @ 2006-06-28  5:04 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Tue, 2006-06-27 at 17:23 -0700, Junio C Hamano wrote:
> For some time, "pu" was left in the state that does not to pass
> the testsuite, but I've fixed what's minimally needed (the
> breakage was mostly from the diff options rewrite).  People who
> regularly follow "next" on platforms other than i386 or x86-64
> Linux might want to try out tonight's "pu" to make sure
> "Git.xs/Git.pm" series works on their box before it hits "next".
> Breakage there would stop your "git pull" working, so this is
> somewhat important.

PowerPC 32-bit, G3, Fedora Core 5, gcc 4.1.1, perl 5.8.8, pu branch
(f5d33e0b4eaa4083b455118a7be473defb61f137)

Warnings:

quote.c: In function 'sq_quote_buf':
quote.c:34: warning: value computed is not used
quote.c:37: warning: value computed is not used
combine-diff.c: In function 'diff_tree_combined':
combine-diff.c:844: warning: assignment makes integer from pointer
without a cast
In file included
from /usr/lib/perl5/5.8.8/ppc-linux-thread-multi/CORE/perl.h:756,
                 from Git.xs:15:
/usr/lib/perl5/5.8.8/ppc-linux-thread-multi/CORE/embed.h:4195:1:
warning: "die" redefined
Git.xs:11:1: warning: this is the location of the previous definition

I'm very concerned about the combine-diff.c warning.  The warning seems
to be legitimate and I don't see an obvious fix.  The offending line
comes from 3969cf7db1a13a78f3b7a36d8c1084bbe0a53459 ("Fix some more diff
options changes"):

show_log_first = rev->loginfo;

The testsuite passes, but "git-pull" is indeed broken:

$ git-pull
Can't locate Git.pm in @INC (@INC
contains: /usr/lib/perl5/site_perl/5.8.8/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.4/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.4/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3/ppc-linux-thread-multi /usr/lib/perl5/vend
 or_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/ppc-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /home/proski/bin/git-fmt-merge-msg line 10.
BEGIN failed--compilation aborted at /home/proski/bin/git-fmt-merge-msg
line 10.

Git.pm is installed into
/home/proski/lib/perl5/site_perl/5.8.8/ppc-linux-thread-multi/

Speaking of x86_64 (also Fedora Core 5, gcc 4.1.1, perl 5.8.8), git
doesn't even build:

In file included
from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/perl.h:756,
                 from Git.xs:15:
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/embed.h:4195:1:
warning: "die" redefined
Git.xs:11:1: warning: this is the location of the previous definition
Running Mkbootstrap for Git ()
chmod 644 Git.bs
rm -f blib/arch/auto/Git/Git.so
gcc  -shared Git.o  -o blib/arch/auto/Git/Git.so ../libgit.a    \
   -lz -lcrypto         \
  
/usr/bin/ld: ../libgit.a(exec_cmd.o): relocation R_X86_64_32 against `a
local symbol' can not be used when making a shared object; recompile
with -fPIC
../libgit.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [blib/arch/auto/Git/Git.so] Error 1
make[1]: Leaving directory `/usr/local/src/git/perl'
make: *** [all] Error 2

The build succeeds if I use following:
make CFLAGS='-g -O2 -Wall -fPIC'

The testsuite passes.  git-pull is also broken with a similar error
message.  Git.pm is installed into
/home/proski/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/

-- 
Regards,
Pavel Roskin

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

* Re: Quick merge status updates.
  2006-06-28  0:23   ` Quick merge status updates Junio C Hamano
  2006-06-28  5:04     ` Pavel Roskin
@ 2006-06-28  7:32     ` Johannes Schindelin
  2006-06-28  7:39       ` Johannes Schindelin
  1 sibling, 1 reply; 27+ messages in thread
From: Johannes Schindelin @ 2006-06-28  7:32 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Hi,

On Tue, 27 Jun 2006, Junio C Hamano wrote:

> Immediately after 1.4.1 happens, I would like to pull in
> "Git.xs/Git.pm" series by Pasky into "next".

Earlier, you said that this is primarily for gitweb, not so much for the 
core of git. But...

> Breakage there would stop your "git pull" working, so this is somewhat 
> important.

May I respectfully offer my objection? This is the _heart_ of git. You do 
not want to muck around with this.

I am not opposed to a sane interface between Perl and git, but please 
please PLEASE do not make such an important part of git dependent on 
Git.pm. (Somehow I have the impressions there are echoes here.)

Ciao,
Dscho

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

* Re: Quick merge status updates.
  2006-06-28  7:32     ` Johannes Schindelin
@ 2006-06-28  7:39       ` Johannes Schindelin
  2006-06-28  8:51         ` Junio C Hamano
  2006-07-01 23:48         ` [PATCH] Git.pm: Avoid ppport.h Petr Baudis
  0 siblings, 2 replies; 27+ messages in thread
From: Johannes Schindelin @ 2006-06-28  7:39 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Hi,

on my iBook, make in pu outputs:

GIT_VERSION = 1.4.1.rc1.gf5d3
    * new build flags or prefix
(cd perl && /usr/bin/perl Makefile.PL \
     PREFIX='/Users/gene099' \
     DEFINE=' -I/sw/include -DSHA1_HEADER='\''<openssl/sha.h>'\'' 
-DNO_STRCASESTR -DNO_STRLCPY -DGIT_VERSION='\''"1.4.1.rc1.gf5d3"'\''' \
     LIBS=' -L/sw/lib -lz  -liconv  -lcrypto -lssl')
Can't locate Devel/PPPort.pm in @INC (@INC contains: 
/System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin 
/Library/Perl /Library/Perl /Network/Library/Perl/darwin 
/Network/Library/Perl /Network/Library/Perl .) at Makefile.PL line 29.
BEGIN failed--compilation aborted at Makefile.PL line 29.
make: *** [perl/Makefile] Error 2

FWIW all Perl scripts in git, except git-send-email, work here.

Ciao,
Dscho

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

* Re: Quick merge status updates.
  2006-06-28  5:04     ` Pavel Roskin
@ 2006-06-28  8:49       ` Junio C Hamano
  2006-06-28 10:05         ` Pavel Roskin
  0 siblings, 1 reply; 27+ messages in thread
From: Junio C Hamano @ 2006-06-28  8:49 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: git

Pavel Roskin <proski@gnu.org> writes:

> PowerPC 32-bit, G3, Fedora Core 5, gcc 4.1.1, perl 5.8.8, pu branch
> (f5d33e0b4eaa4083b455118a7be473defb61f137)

Thanks.

> Warnings:
>
> quote.c: In function 'sq_quote_buf':
> quote.c:34: warning: value computed is not used
> quote.c:37: warning: value computed is not used

Thanks.  I think these are dealt with Jeff King's patches.

> combine-diff.c: In function 'diff_tree_combined':
> combine-diff.c:844: warning: assignment makes integer from pointer
> without a cast

Thanks.  The fix is actually simple (two paragraphs below).

> In file included
> from /usr/lib/perl5/5.8.8/ppc-linux-thread-multi/CORE/perl.h:756,
>                  from Git.xs:15:
> /usr/lib/perl5/5.8.8/ppc-linux-thread-multi/CORE/embed.h:4195:1:
> warning: "die" redefined
> Git.xs:11:1: warning: this is the location of the previous definition

I've seen this but haven't looked into it.  Pasky?

> I'm very concerned about the combine-diff.c warning.  The warning seems
> to be legitimate and I don't see an obvious fix.  The offending line
> comes from 3969cf7db1a13a78f3b7a36d8c1084bbe0a53459 ("Fix some more diff
> options changes"):
>
> show_log_first = rev->loginfo;

This is saying "If rev->loginfo is pointing at some string, we
are going to show the log message first and then output from the
diff machinery (otherwise rev->loginfo has NULL)".  I'll
rephrase it to read as:

	show_log_first = !!rev->loginfo;

> The testsuite passes, but "git-pull" is indeed broken:
>
> $ git-pull
> Can't locate Git.pm in @INC (@INC
> contains: /usr/lib/perl5/site_perl/5.8.8/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.4/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.4/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3/ppc-linux-thread-multi /usr/lib/perl5/ve
 ndor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/ppc-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /home/proski/bin/git-fmt-merge-msg line 10.
> BEGIN failed--compilation aborted at /home/proski/bin/git-fmt-merge-msg
> line 10.
>
> Git.pm is installed into
> /home/proski/lib/perl5/site_perl/5.8.8/ppc-linux-thread-multi/

The same problem with the last paragraph.

> Speaking of x86_64 (also Fedora Core 5, gcc 4.1.1, perl 5.8.8), git
> doesn't even build:

	$ git grep -A1 -e 'Define USE_PIC" pu:Makefile

in other words:

	USE_PIC=YesPlease make

> The testsuite passes.  git-pull is also broken with a similar error
> message.  Git.pm is installed into
> /home/proski/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/

I suspect this is either FC perl-dev package is broken (I doubt
it) or your installation procedure is pecurilar (much more
likely).  I pass the same set of prefix, bindir and friends to
"make" and "make install" and do not see the problem.

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

* Re: Quick merge status updates.
  2006-06-28  7:39       ` Johannes Schindelin
@ 2006-06-28  8:51         ` Junio C Hamano
  2006-06-28  9:13           ` Johannes Schindelin
  2006-07-01 23:48         ` [PATCH] Git.pm: Avoid ppport.h Petr Baudis
  1 sibling, 1 reply; 27+ messages in thread
From: Junio C Hamano @ 2006-06-28  8:51 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git, pasky

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

> Hi,
>
> on my iBook, make in pu outputs:
>
> GIT_VERSION = 1.4.1.rc1.gf5d3
>     * new build flags or prefix
> (cd perl && /usr/bin/perl Makefile.PL \
>      PREFIX='/Users/gene099' \
>      DEFINE=' -I/sw/include -DSHA1_HEADER='\''<openssl/sha.h>'\'' 
> -DNO_STRCASESTR -DNO_STRLCPY -DGIT_VERSION='\''"1.4.1.rc1.gf5d3"'\''' \
>      LIBS=' -L/sw/lib -lz  -liconv  -lcrypto -lssl')
> Can't locate Devel/PPPort.pm in @INC (@INC contains: 
> /System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin 
> /Library/Perl /Library/Perl /Network/Library/Perl/darwin 
> /Network/Library/Perl /Network/Library/Perl .) at Makefile.PL line 29.
> BEGIN failed--compilation aborted at Makefile.PL line 29.
> make: *** [perl/Makefile] Error 2
>
> FWIW all Perl scripts in git, except git-send-email, work here.

I suspect git-fmt-merge-msg doesn't, and perhaps git-mv.

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

* Re: Quick merge status updates.
  2006-06-28  8:51         ` Junio C Hamano
@ 2006-06-28  9:13           ` Johannes Schindelin
  0 siblings, 0 replies; 27+ messages in thread
From: Johannes Schindelin @ 2006-06-28  9:13 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, pasky

Hi,

On Wed, 28 Jun 2006, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > Hi,
> >
> > on my iBook, make in pu outputs:
> >
> > GIT_VERSION = 1.4.1.rc1.gf5d3
> >     * new build flags or prefix
> > (cd perl && /usr/bin/perl Makefile.PL \
> >      PREFIX='/Users/gene099' \
> >      DEFINE=' -I/sw/include -DSHA1_HEADER='\''<openssl/sha.h>'\'' 
> > -DNO_STRCASESTR -DNO_STRLCPY -DGIT_VERSION='\''"1.4.1.rc1.gf5d3"'\''' \
> >      LIBS=' -L/sw/lib -lz  -liconv  -lcrypto -lssl')
> > Can't locate Devel/PPPort.pm in @INC (@INC contains: 
> > /System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin 
> > /Library/Perl /Library/Perl /Network/Library/Perl/darwin 
> > /Network/Library/Perl /Network/Library/Perl .) at Makefile.PL line 29.
> > BEGIN failed--compilation aborted at Makefile.PL line 29.
> > make: *** [perl/Makefile] Error 2
> >
> > FWIW all Perl scripts in git, except git-send-email, work here.
> 
> I suspect git-fmt-merge-msg doesn't, and perhaps git-mv.

Last time I checked, git-mv worked (couple of weeks ago). And if I am not 
mistaken, git-fmt-merge-msg is needed when git-pull does not fast forward? 
I definitely successfully merged on my iBook, IIRC last time was last 
week.

BTW: Devel/PPPort.pm is introduced by this line in perl/Git.xs:

> #include "ppport.h"

Ciao,
Dscho

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

* Re: Quick merge status updates.
  2006-06-28  8:49       ` Junio C Hamano
@ 2006-06-28 10:05         ` Pavel Roskin
  2006-06-28 10:14           ` Junio C Hamano
  2006-07-02 20:49           ` Petr Baudis
  0 siblings, 2 replies; 27+ messages in thread
From: Pavel Roskin @ 2006-06-28 10:05 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Wed, 2006-06-28 at 01:49 -0700, Junio C Hamano wrote:

> I suspect this is either FC perl-dev package is broken (I doubt
> it) or your installation procedure is pecurilar (much more
> likely).  I pass the same set of prefix, bindir and friends to
> "make" and "make install" and do not see the problem.

I think my Perl 5.8.8 is "too new".  "man perlfunc" says about "use":

"Imports some semantics into the current package from the named module,
generally by aliasing certain subroutine or variable names into your
package.  It is exactly equivalent to

      BEGIN { require Module; import Module LIST; }

except that Module must be a bareword."

I think the BEGIN block has priority over other statements.  My solution
was to put the @INC change in the BEGIN block as well.

This patch is working for me:

diff --git a/git-fmt-merge-msg.perl b/git-fmt-merge-msg.perl
index e8fad02..1b23fa1 100755
--- a/git-fmt-merge-msg.perl
+++ b/git-fmt-merge-msg.perl
@@ -5,7 +5,7 @@ #
 # Read .git/FETCH_HEAD and make a human readable merge message
 # by grouping branches and tags together to form a single line.
 
-unshift @INC, '@@INSTLIBDIR@@';
+BEGIN { unshift @INC, '@@INSTLIBDIR@@'; }
 use strict;
 use Git;
 use Error qw(:try);


-- 
Regards,
Pavel Roskin

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

* Re: Quick merge status updates.
  2006-06-28 10:05         ` Pavel Roskin
@ 2006-06-28 10:14           ` Junio C Hamano
  2006-07-02 20:49           ` Petr Baudis
  1 sibling, 0 replies; 27+ messages in thread
From: Junio C Hamano @ 2006-06-28 10:14 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: git

Pavel Roskin <proski@gnu.org> writes:

> I think my Perl 5.8.8 is "too new".  "man perlfunc" says about "use":
> ...
> I think the BEGIN block has priority over other statements.  My solution
> was to put the @INC change in the BEGIN block as well.

Actually I do use 5.8.8 and everything you quoted makes perfect
sense, -- in fact now I do not know *why* it did _not_ break for
me without the BEGIN {} block, especially I do not have any
PERL* environment variable to point at anywhere under $HOME.

Thanks for the fix.

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

* [PATCH] Git.pm: Avoid ppport.h
  2006-06-28  7:39       ` Johannes Schindelin
  2006-06-28  8:51         ` Junio C Hamano
@ 2006-07-01 23:48         ` Petr Baudis
  2006-07-02  9:52           ` Johannes Schindelin
  1 sibling, 1 reply; 27+ messages in thread
From: Petr Baudis @ 2006-07-01 23:48 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Junio C Hamano, git

  Hi,

Dear diary, on Wed, Jun 28, 2006 at 09:39:46AM CEST, I got a letter
where Johannes Schindelin <Johannes.Schindelin@gmx.de> said that...
> on my iBook, make in pu outputs:
> 
> GIT_VERSION = 1.4.1.rc1.gf5d3
>     * new build flags or prefix
> (cd perl && /usr/bin/perl Makefile.PL \
>      PREFIX='/Users/gene099' \
>      DEFINE=' -I/sw/include -DSHA1_HEADER='\''<openssl/sha.h>'\'' 
> -DNO_STRCASESTR -DNO_STRLCPY -DGIT_VERSION='\''"1.4.1.rc1.gf5d3"'\''' \
>      LIBS=' -L/sw/lib -lz  -liconv  -lcrypto -lssl')
> Can't locate Devel/PPPort.pm in @INC (@INC contains: 
> /System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin 
> /Library/Perl /Library/Perl /Network/Library/Perl/darwin 
> /Network/Library/Perl /Network/Library/Perl .) at Makefile.PL line 29.
> BEGIN failed--compilation aborted at Makefile.PL line 29.
> make: *** [perl/Makefile] Error 2

  ow, Devel::PPPort might not be around all the way back to 5.6.0. What
is your Perl version, BTW?

->8-

This makes us not include ppport.h which seems not to give us anything real
anyway; it is useful for checking for portability warts but since Devel::PPPort
is a portability wart itself, we shouldn't require it for build. You can check
for portability problems by calling make check in perl/.

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

 perl/Git.xs      |    2 --
 perl/Makefile.PL |   10 +++++-----
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/perl/Git.xs b/perl/Git.xs
index cb23261..51bfac3 100644
--- a/perl/Git.xs
+++ b/perl/Git.xs
@@ -15,8 +15,6 @@ #include "EXTERN.h"
 #include "perl.h"
 #include "XSUB.h"
 
-#include "ppport.h"
-
 #undef die
 
 
diff --git a/perl/Makefile.PL b/perl/Makefile.PL
index 25ae54a..97ee9af 100644
--- a/perl/Makefile.PL
+++ b/perl/Makefile.PL
@@ -5,6 +5,11 @@ sub MY::postamble {
 instlibdir:
 	@echo '$(INSTALLSITEARCH)'
 
+check:
+	perl -MDevel::PPPort -le 'Devel::PPPort::WriteFile(".ppport.h")' && \
+	perl .ppport.h --compat-version=5.6.0 Git.xs && \
+	rm .ppport.h
+
 MAKE_FRAG
 }
 
@@ -24,8 +29,3 @@ WriteMakefile(
 	MYEXTLIB        => '../libgit.a',
 	INC             => '-I. -I..',
 );
-
-
-use Devel::PPPort;
-
--s 'ppport.h' or Devel::PPPort::WriteFile();

-- 
				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 related	[flat|nested] 27+ messages in thread

* Re: [PATCH] Git.pm: Avoid ppport.h
  2006-07-01 23:48         ` [PATCH] Git.pm: Avoid ppport.h Petr Baudis
@ 2006-07-02  9:52           ` Johannes Schindelin
  2006-07-02 19:05             ` Junio C Hamano
  0 siblings, 1 reply; 27+ messages in thread
From: Johannes Schindelin @ 2006-07-02  9:52 UTC (permalink / raw)
  To: Petr Baudis; +Cc: Junio C Hamano, git

Hi,

On Sun, 2 Jul 2006, Petr Baudis wrote:

>   ow, Devel::PPPort might not be around all the way back to 5.6.0. What
> is your Perl version, BTW?

This is perl, v5.6.0 built for darwin

> This makes us not include ppport.h which seems not to give us anything real
> anyway; it is useful for checking for portability warts but since Devel::PPPort
> is a portability wart itself, we shouldn't require it for build.

Why do people introduce a "portability enhancer" like that? This is soo 
dumb.

Well, your patch helped. Now the error is somewhere else:

mkdir blib
mkdir blib/lib
mkdir blib/arch
mkdir blib/arch/auto
mkdir blib/arch/auto/Git
mkdir blib/lib/auto
mkdir blib/lib/auto/Git
mkdir blib/man3
cp private-Error.pm blib/lib/Error.pm
cp Git.pm blib/lib/Git.pm
/usr/bin/perl -I/System/Library/Perl/darwin -I/System/Library/Perl 
/System/Library/Perl/ExtUtils/xsubpp  -typemap 
/System/Library/Perl/ExtUtils/typemap Git.xs > Git.xsc && mv Git.xsc Git.c
Error: 'const char *' not in typemap in Git.xs, line 69
Error: 'const char *' not in typemap in Git.xs, line 79
make: *** [Git.c] Error 1

It seems like my typemap starts like this:

-- snip --
# $Header: /cvs/Darwin/src/live/perl/perl/lib/ExtUtils/typemap,v 1.2 
2002/03/14 
08:58:22 zarzycki Exp $ 
# basic C types
int                     T_IV
unsigned                T_UV
unsigned int            T_UV
long                    T_IV
unsigned long           T_UV
short                   T_IV
unsigned short          T_UV
char                    T_CHAR
unsigned char           T_U_CHAR
char *                  T_PV
unsigned char *         T_PV
caddr_t                 T_PV
wchar_t *               T_PV
wchar_t                 T_IV
bool_t                  T_IV
size_t                  T_IV
ssize_t                 T_IV
time_t                  T_NV
-- snap --

So, no "const char *". See next mail for a minimal patch. The warning 
(IIRC that was mentioned already on the list) still persists:

cc -c -I. -I.. -g -pipe -pipe -fno-common -no-cpp-precomp -flat_namespace 
-DHAS_TELLDIR_PROTOTYPE -fno-strict-aliasing -Os     -DVERSION=\"0.01\" 
-DXS_VERSION=\"0.01\"  -I/System/Library/Perl/darwin/CORE -I/sw/include 
-DSHA1_HEADER='<openssl/sha.h>' -DNO_STRCASESTR -DNO_STRLCPY 
-DGIT_VERSION='"1.4.1.g3b26"' Git.c
In file included from /System/Library/Perl/darwin/CORE/perl.h:500,
                 from Git.xs:15:
/System/Library/Perl/darwin/CORE/embed.h:156:1: warning: "die" redefined
Git.xs:11:1: warning: this is the location of the previous definition

Ciao,
Dscho

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

* Re: [PATCH] Git.pm: Avoid ppport.h
  2006-07-02  9:52           ` Johannes Schindelin
@ 2006-07-02 19:05             ` Junio C Hamano
  2006-07-02 20:57               ` [PATCH] Git.pm: Don't #define around die Petr Baudis
  0 siblings, 1 reply; 27+ messages in thread
From: Junio C Hamano @ 2006-07-02 19:05 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git, Petr Baudis

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

>> This makes us not include ppport.h which seems not to give us anything real
>> anyway; it is useful for checking for portability warts but since Devel::PPPort
>> is a portability wart itself, we shouldn't require it for build.
>
> Why do people introduce a "portability enhancer" like that? This is soo 
> dumb.

I think that statement is a bit too harsh.

My understanding is that it's more for use by developers working
with later version to produce portability headers, so used that
way it is very sane.  From its manual page:

       How to use ppport.h

       Don't direct the users of your module to download "Devel::PPPort".
       They are most probably no XS writers. Also, don't make ppport.h
       optional. Rather, just take the most recent copy of ppport.h that you
       can find (e.g. by generating it with the latest "Devel::PPPort" release
       from CPAN), copy it into your project, adjust your project to use it,
       and distribute the header along with your module.

But in the case of source distribution, and if the source
distribution wants to be compatible with older versions, the
above advice does not apply.

> Error: 'const char *' not in typemap in Git.xs, line 69
> Error: 'const char *' not in typemap in Git.xs, line 79
> make: *** [Git.c] Error 1
>
> It seems like my typemap starts like this:
>...
> So, no "const char *". See next mail for a minimal patch.

An alternative would be to carry our own typemap but I think
your fix is less intrusive and fine.  Pasky?

> The warning 
> (IIRC that was mentioned already on the list) still persists:
>
> cc -c -I. -I.. -g -pipe -pipe -fno-common -no-cpp-precomp -flat_namespace 
> -DHAS_TELLDIR_PROTOTYPE -fno-strict-aliasing -Os     -DVERSION=\"0.01\" 
> -DXS_VERSION=\"0.01\"  -I/System/Library/Perl/darwin/CORE -I/sw/include 
> -DSHA1_HEADER='<openssl/sha.h>' -DNO_STRCASESTR -DNO_STRLCPY 
> -DGIT_VERSION='"1.4.1.g3b26"' Git.c
> In file included from /System/Library/Perl/darwin/CORE/perl.h:500,
>                  from Git.xs:15:
> /System/Library/Perl/darwin/CORE/embed.h:156:1: warning: "die" redefined
> Git.xs:11:1: warning: this is the location of the previous definition

I see the same here.

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

* Re: Quick merge status updates.
  2006-06-28 10:05         ` Pavel Roskin
  2006-06-28 10:14           ` Junio C Hamano
@ 2006-07-02 20:49           ` Petr Baudis
  2006-07-02 21:33             ` Junio C Hamano
  2006-07-08  7:36             ` Quick merge status updates Pavel Roskin
  1 sibling, 2 replies; 27+ messages in thread
From: Petr Baudis @ 2006-07-02 20:49 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: Junio C Hamano, git

Dear diary, on Wed, Jun 28, 2006 at 12:05:03PM CEST, I got a letter
where Pavel Roskin <proski@gnu.org> said that...
> I think the BEGIN block has priority over other statements.  My solution
> was to put the @INC change in the BEGIN block as well.
> 
> This patch is working for me:
> 
> diff --git a/git-fmt-merge-msg.perl b/git-fmt-merge-msg.perl
> index e8fad02..1b23fa1 100755
> --- a/git-fmt-merge-msg.perl
> +++ b/git-fmt-merge-msg.perl
> @@ -5,7 +5,7 @@ #
>  # Read .git/FETCH_HEAD and make a human readable merge message
>  # by grouping branches and tags together to form a single line.
>  
> -unshift @INC, '@@INSTLIBDIR@@';
> +BEGIN { unshift @INC, '@@INSTLIBDIR@@'; }
>  use strict;
>  use Git;
>  use Error qw(:try);

I feel that it is time for another stupid question of mine - why can't
you just use lib?

	use lib ('@@INSTLIBDIR@@');

Looks a lot better than some @INC unshifting, and it should be
equivalent.

Let's pour in to the confusion:

The unshifting was introduced w/o BEGIN{} in

	From: Junio C Hamano <junkio@cox.net>
	Subject: Re: [PATCH 01/12] Introduce Git.pm (v4)
	Date:   Sat, 24 Jun 2006 04:57:31 -0700

but that patch is not in pu anymore while the description of the new
patch implicitly refers to it, which made it all a bit confusing.

So the purpose of the original patch was to make it play nicely with
$PERLLIB, but unshifting helps nothing, since:

	There's default @INC
	Perl spots PERLLIB and unshifts @INC
	We then unshift @INC too, taking precedence

So didn't the original patch rather want to do push?

	$ PERL5LIB=perl perl -le "BEGIN { unshift @INC, '/home/xpasky/lib/perl5/site_perl/5.8.8/i686-linux'; } use Git; print Git::hash_object('blob','Makefile');"
	17842a3657ae8e5b4fd3ddfeb69268a4b94cb97a
	$ PERL5LIB=perl perl -le "use Git; print Git::hash_object('blob','Makefile');"
	syntax error at perl/Git.pm line 44, near "h>"

(after inserting random junk to perl/Git.pm)

-- 
				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] 27+ messages in thread

* [PATCH] Git.pm: Don't #define around die
  2006-07-02 19:05             ` Junio C Hamano
@ 2006-07-02 20:57               ` Petr Baudis
  0 siblings, 0 replies; 27+ messages in thread
From: Petr Baudis @ 2006-07-02 20:57 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Schindelin, git

Dear diary, on Sun, Jul 02, 2006 at 09:05:33PM CEST, I got a letter
where Junio C Hamano <junkio@cox.net> said that...
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> > Error: 'const char *' not in typemap in Git.xs, line 69
> > Error: 'const char *' not in typemap in Git.xs, line 79
> > make: *** [Git.c] Error 1
> >
> > It seems like my typemap starts like this:
> >...
> > So, no "const char *". See next mail for a minimal patch.
> 
> An alternative would be to carry our own typemap but I think
> your fix is less intrusive and fine.  Pasky?

Yes, it should be fine.

> > The warning 
> > (IIRC that was mentioned already on the list) still persists:
> >
> > cc -c -I. -I.. -g -pipe -pipe -fno-common -no-cpp-precomp -flat_namespace 
> > -DHAS_TELLDIR_PROTOTYPE -fno-strict-aliasing -Os     -DVERSION=\"0.01\" 
> > -DXS_VERSION=\"0.01\"  -I/System/Library/Perl/darwin/CORE -I/sw/include 
> > -DSHA1_HEADER='<openssl/sha.h>' -DNO_STRCASESTR -DNO_STRLCPY 
> > -DGIT_VERSION='"1.4.1.g3b26"' Git.c
> > In file included from /System/Library/Perl/darwin/CORE/perl.h:500,
> >                  from Git.xs:15:
> > /System/Library/Perl/darwin/CORE/embed.h:156:1: warning: "die" redefined
> > Git.xs:11:1: warning: this is the location of the previous definition
> 
> I see the same here.

-8<-

Back in the old days, we called Git's die() from the .xs code, but we had to
hijack Perl's die() for that. Now we don't call Git's die() so no need to do
the hijacking and it silences a compiler warning.

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

 perl/Git.xs |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/perl/Git.xs b/perl/Git.xs
index 51bfac3..1e6c1eb 100644
--- a/perl/Git.xs
+++ b/perl/Git.xs
@@ -8,15 +8,11 @@ #include <ctype.h>
 #include "../cache.h"
 #include "../exec_cmd.h"
 
-#define die perlyshadow_die__
-
 /* XS and Perl interface */
 #include "EXTERN.h"
 #include "perl.h"
 #include "XSUB.h"
 
-#undef die
-
 
 static char *
 report_xs(const char *prefix, const char *err, va_list params)

-- 
				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 related	[flat|nested] 27+ messages in thread

* Re: Quick merge status updates.
  2006-07-02 20:49           ` Petr Baudis
@ 2006-07-02 21:33             ` Junio C Hamano
  2006-07-02 21:49               ` Petr Baudis
  2006-07-08  7:36             ` Quick merge status updates Pavel Roskin
  1 sibling, 1 reply; 27+ messages in thread
From: Junio C Hamano @ 2006-07-02 21:33 UTC (permalink / raw)
  To: Petr Baudis; +Cc: git

Petr Baudis <pasky@suse.cz> writes:

> So the purpose of the original patch was to make it play nicely with
> $PERLLIB, but unshifting helps nothing, since:
>
> 	There's default @INC
> 	Perl spots PERLLIB and unshifts @INC
> 	We then unshift @INC too, taking precedence

I tried this:

 0. check out the branch that has the Perly git ("pu").  build
    and install normally to have a perfectly working version
    accessible on your usual $PATH.

 1. apply the patch [1] below to make it use "use lib" instead of
    "unshift".

 2. break perl/Git.pm being built to pretend we introduced a bug
    in the work in progress by applying the patch [2] below.

 3. without installing the broken Git.pm, run "make test", and
    see a test that uses "git pull" and needs to create a true
    merge succeed.  It tells me that everything including
    perl/Git.pm is GOOD, and I'd find the breakage only after
    installing and running the test again.

If you make the freshly built script to say "use lib" to use
Git.pm and its friends from the installed location, it defeats
the attempt by test-lib.sh to override it to test what we
freshly built -- the use of "unshift @INC" is to work that
around and is parallel to the way Python stuff works around the
same problem.

[Footnotes]
*1* "use lib" patch.

diff --git a/git-fmt-merge-msg.perl b/git-fmt-merge-msg.perl
index 1b23fa1..3a42950 100755
--- a/git-fmt-merge-msg.perl
+++ b/git-fmt-merge-msg.perl
@@ -5,7 +5,7 @@ #
 # Read .git/FETCH_HEAD and make a human readable merge message
 # by grouping branches and tags together to form a single line.
 
-BEGIN { unshift @INC, '@@INSTLIBDIR@@'; }
+use lib '@@INSTLIBDIR@@';
 use strict;
 use Git;
 use Error qw(:try);

*2* "break Git.pm" patch.

diff --git a/perl/Git.pm b/perl/Git.pm
index b4ee88b..34b4f12 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -6,6 +6,7 @@ Git - Perl interface to the Git version 
 
 
 package Git;
+syntax error -- kill me
 
 use strict;
 

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

* Making perl scripts include the correct Git.pm
@ 2006-07-02 21:40 Petr Baudis
  2006-07-03  0:02 ` Junio C Hamano
  0 siblings, 1 reply; 27+ messages in thread
From: Petr Baudis @ 2006-07-02 21:40 UTC (permalink / raw)
  To: git

  Hi,

  the discussion of the topic became so scatterred that it's rather
difficult to follow now and I get a feeling that we are kind of running
in circles now, so this is my attempt to summarize it:

  Desired behaviour when running Git's perl scripts (ordered by
degree of necessity):

  (D1) When running installed script, it should include Git.pm from the
same installation.

  (D2) When running the testsuite, it should include Git.pm from the
source tree.

  (D3) When running script directly from source tree, it should include
Git.pm from the source tree.


  (i) The original solution passed -I on the #!/usr/bin/perl line, but
that was ugly, was prone to hit various OS limits on the shebang line
and violated both (D2) and (D3).


  (ii) My proposed second solution was to add an autogenerated line to
the Git's perl scripts saying something like:

	use lib ('instlibdir', 'srclibdir');

This fulfills all (D1), (D2) and (D3), but is perceived by Junio as
"disgusting".


  (iii) The currently used solution is to effectively

	use lib ('instlibdir');

to the Git's perl scripts. This violated (D3) and (D2) too, since
use lib is the last from all the @INC modifiers to be seen and thus
overrides and $PERL5LIB set in the testsuite.


  (iv) Variation of (iii), probably Junio's original intention when
implementing it:

	push @INC, 'instlibdir';

This fulfills (D2). It does not fulfill (D3) per se since the user
has to set $PERL5LIB manually when running Git without installing it,
but it is at least fulfillable. However, most importantly this does
not even fulfill (D1) since if you e.g. consider user-local installation
of Git over system-wide installation of Git, local perl scripts will
use the globally installed Git.pm.


  (v) If you throw away user-friendly (D3) requirement and insist
on (iii) being disgusting, this is a newly proposed possible variation
"(iv) meets (i)":

	#!/usr/bin/perl -Imarker
	@INC = map { $_ eq 'marker' ? 'instlibdir' : $_ } @INC;

(I think this is more disgusting than (iii), but tastes differ. ;)


  So, what's the way out?


  PS: Is this the only remaining problem with Git.pm or do we have
anything else to cope with, esp. before it gets considered to be a
next material?

-- 
				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] 27+ messages in thread

* Re: Quick merge status updates.
  2006-07-02 21:33             ` Junio C Hamano
@ 2006-07-02 21:49               ` Petr Baudis
  2006-07-02 22:50                 ` Junio C Hamano
  0 siblings, 1 reply; 27+ messages in thread
From: Petr Baudis @ 2006-07-02 21:49 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Dear diary, on Sun, Jul 02, 2006 at 11:33:47PM CEST, I got a letter
where Junio C Hamano <junkio@cox.net> said that...
> I tried this:
> 
>  0. check out the branch that has the Perly git ("pu").  build
>     and install normally to have a perfectly working version
>     accessible on your usual $PATH.
> 
>  1. apply the patch [1] below to make it use "use lib" instead of
>     "unshift".
> 
>  2. break perl/Git.pm being built to pretend we introduced a bug
>     in the work in progress by applying the patch [2] below.
> 
>  3. without installing the broken Git.pm, run "make test", and
>     see a test that uses "git pull" and needs to create a true
>     merge succeed.  It tells me that everything including
>     perl/Git.pm is GOOD, and I'd find the breakage only after
>     installing and running the test again.

So, just to clarify and make sure we understand each other perfectly,
you claim that when skipping (1), (3) _does_ FAIL for you? Because it
really doesn't for me and I can't see how could it ever fail without
installing the broken version first.

-- 
				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] 27+ messages in thread

* Re: Quick merge status updates.
  2006-07-02 21:49               ` Petr Baudis
@ 2006-07-02 22:50                 ` Junio C Hamano
  2006-07-02 23:49                   ` Junio C Hamano
  0 siblings, 1 reply; 27+ messages in thread
From: Junio C Hamano @ 2006-07-02 22:50 UTC (permalink / raw)
  To: Petr Baudis; +Cc: git

Petr Baudis <pasky@suse.cz> writes:

> Dear diary, on Sun, Jul 02, 2006 at 11:33:47PM CEST, I got a letter
> where Junio C Hamano <junkio@cox.net> said that...
>> I tried this:
>> 
>>  0. check out the branch that has the Perly git ("pu").  build
>>     and install normally to have a perfectly working version
>>     accessible on your usual $PATH.
>> 
>>  1. apply the patch [1] below to make it use "use lib" instead of
>>     "unshift".
>> 
>>  2. break perl/Git.pm being built to pretend we introduced a bug
>>     in the work in progress by applying the patch [2] below.
>> 
>>  3. without installing the broken Git.pm, run "make test", and
>>     see a test that uses "git pull" and needs to create a true
>>     merge succeed.  It tells me that everything including
>>     perl/Git.pm is GOOD, and I'd find the breakage only after
>>     installing and running the test again.
>
> So, just to clarify and make sure we understand each other perfectly,
> you claim that when skipping (1), (3) _does_ FAIL for you? Because it
> really doesn't for me and I can't see how could it ever fail without
> installing the broken version first.

Gaah.  You are right.

PERL5LIB does not seem to just do a push (and that was I thought
why unshift was a way to defeat it) but do something more evil.

With this:

diff --git a/git-fmt-merge-msg.perl b/git-fmt-merge-msg.perl
index 1b23fa1..5d1ae44 100755
--- a/git-fmt-merge-msg.perl
+++ b/git-fmt-merge-msg.perl
@@ -6,9 +6,11 @@ # Read .git/FETCH_HEAD and make a human 
 # by grouping branches and tags together to form a single line.
 
 BEGIN { unshift @INC, '@@INSTLIBDIR@@'; }
+use lib '@@INSTLIBDIR@@';
 use strict;
 use Git;
 use Error qw(:try);
+print STDERR "\@INC is @INC\n";
 
 my $repo = Git->repository();
 
It spits this out: 

@INC is /home/junio/git-pu/lib/perl/5.8.8 /opt/git/git.git/t/../perl/blib/lib /opt/git/git.git/t/../perl/blib/arch/auto/Git /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .

So "BEGIN { unshift }" is JUST AS WRONG as "use lib".

I thought we killed this showstopper and was hoping now the
series is mergeable to "next" but apparently not yet X-<.

Sigh....

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

* Re: Quick merge status updates.
  2006-07-02 22:50                 ` Junio C Hamano
@ 2006-07-02 23:49                   ` Junio C Hamano
  2006-07-03  0:00                     ` Linus Torvalds
  2006-07-03 20:29                     ` Petr Baudis
  0 siblings, 2 replies; 27+ messages in thread
From: Junio C Hamano @ 2006-07-02 23:49 UTC (permalink / raw)
  To: Petr Baudis; +Cc: git

Junio C Hamano <junkio@cox.net> writes:

> Gaah.  You are right.
>
> PERL5LIB does not seem to just do a push (and that was I thought
> why unshift was a way to defeat it) but do something more evil.
> ...
> I thought we killed this showstopper and was hoping now the
> series is mergeable to "next" but apparently not yet X-<.
>
> Sigh....

Yuck; that means we would need to have something evil like this.

-- >8 --
Perly Git: make sure we do test the freshly built one.

We could BEGIN { push @INC, '@@INSTLIBDIR@@'; } but that is not
a good idea for normal execution.  The would prevent a
workaround for a user who is trying to override an old, faulty
Git.pm installed on the system path with a newer version
installed under $HOME/.

Signed-off-by: Junio C Hamano <junkio@cox.net>

---
diff --git a/git-fmt-merge-msg.perl b/git-fmt-merge-msg.perl
index 1b23fa1..a9805dd 100755
--- a/git-fmt-merge-msg.perl
+++ b/git-fmt-merge-msg.perl
@@ -5,7 +5,11 @@ #
 # Read .git/FETCH_HEAD and make a human readable merge message
 # by grouping branches and tags together to form a single line.
 
-BEGIN { unshift @INC, '@@INSTLIBDIR@@'; }
+BEGIN {
+	unless (exists $ENV{'RUNNING_GIT_TESTS'}) {
+		unshift @INC, '@@INSTLIBDIR@@';
+	}
+}
 use strict;
 use Git;
 use Error qw(:try);
diff --git a/git-mv.perl b/git-mv.perl
index a604896..5134b80 100755
--- a/git-mv.perl
+++ b/git-mv.perl
@@ -6,7 +6,11 @@ #
 # This file is licensed under the GPL v2, or a later version
 # at the discretion of Linus Torvalds.
 
-BEGIN { unshift @INC, '@@INSTLIBDIR@@'; }
+BEGIN {
+	unless (exists $ENV{'RUNNING_GIT_TESTS'}) {
+		unshift @INC, '@@INSTLIBDIR@@';
+	}
+}
 use warnings;
 use strict;
 use Getopt::Std;
diff --git a/t/test-lib.sh b/t/test-lib.sh
index fba0c51..298c6ca 100755
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -206,8 +206,9 @@ PYTHON=`sed -e '1{
 	PYTHONPATH=$(pwd)/../compat
 	export PYTHONPATH
 }
+RUNNING_GIT_TESTS=YesWeAre
 PERL5LIB=$(pwd)/../perl/blib/lib:$(pwd)/../perl/blib/arch/auto/Git
-export PERL5LIB
+export PERL5LIB RUNNING_GIT_TESTS
 test -d ../templates/blt || {
 	error "You haven't built things yet, have you?"
 }

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

* Re: Quick merge status updates.
  2006-07-02 23:49                   ` Junio C Hamano
@ 2006-07-03  0:00                     ` Linus Torvalds
  2006-07-03  0:06                       ` Junio C Hamano
  2006-07-03 20:29                     ` Petr Baudis
  1 sibling, 1 reply; 27+ messages in thread
From: Linus Torvalds @ 2006-07-03  0:00 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Petr Baudis, git



On Sun, 2 Jul 2006, Junio C Hamano wrote:
> Yuck; that means we would need to have something evil like this.

That's just disgusting.

How about a _much_ simpler approach.

Just make it do

	BEGIN { push ENV{'GIT_PERL_EXEC_DIR'}; }

And then simply _require_ that the setup code sets up GIT_PERL_EXEC_DIR.

Which is usually simple enough to do. For git.c, something like this will 
do it, other places you can reach things through can have something 
similar.

		Linus

---

diff --git a/git.c b/git.c
index ca8961f..e8f25ee 100644
--- a/git.c
+++ b/git.c
@@ -294,6 +294,7 @@ int main(int argc, const char **argv, ch
 		prepend_to_path(exec_path, strlen(exec_path));
 	exec_path = git_exec_path();
 	prepend_to_path(exec_path, strlen(exec_path));
+	setenv(exec_path, "GIT_PERL_EXEC_DIR", 0);
 
 	while (1) {
 		/* See if it's an internal command */

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

* Re: Making perl scripts include the correct Git.pm
  2006-07-02 21:40 Making perl scripts include the correct Git.pm Petr Baudis
@ 2006-07-03  0:02 ` Junio C Hamano
  2006-06-28  0:23   ` Quick merge status updates Junio C Hamano
  2006-07-03  1:38   ` Making perl scripts include the correct Git.pm Junio C Hamano
  0 siblings, 2 replies; 27+ messages in thread
From: Junio C Hamano @ 2006-07-03  0:02 UTC (permalink / raw)
  To: Petr Baudis; +Cc: git

Petr Baudis <pasky@suse.cz> writes:

> so this is my attempt to summarize it:

Ah, our message crossed -- thanks for summarizing it.  I do not
particularly like any of the solution so far, but maybe the
patch I just sent out to "do the normal thing unless we are
running tests" might be the right thing to do.

>   (ii) My proposed second solution was to add an autogenerated line to
> the Git's perl scripts saying something like:
>
> 	use lib ('instlibdir', 'srclibdir');
>
> This fulfills all (D1), (D2) and (D3)

If you have srclibdir after instlibdir, aren't you breaking D2?

And I do not think swapping them is right either.  It would
fullfil D1/D2/D3 but I think it has one bad side effect.

Namely, I do not want an installed script, maybe coming from the
vendor, to be affected by whatever unrelated garbage the end
user happens to have on the same path as the one used for
building the module on potentially remote machine, so I would
like to avoid including srclibdir anywhere on the include path
for normal execution.

That is, if I built a binary package in /home/junio/git/git.git
on my machine to be installed in /usr/lib/perl/somewhere, the
users on a multi-user system can be tricked to run random stuff
that happens to be in /home/junio/git/git.git/ directory on
their machine.

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

* Re: Quick merge status updates.
  2006-07-03  0:00                     ` Linus Torvalds
@ 2006-07-03  0:06                       ` Junio C Hamano
  0 siblings, 0 replies; 27+ messages in thread
From: Junio C Hamano @ 2006-07-03  0:06 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git

Linus Torvalds <torvalds@osdl.org> writes:

> On Sun, 2 Jul 2006, Junio C Hamano wrote:
>> Yuck; that means we would need to have something evil like this.
>
> That's just disgusting.
>
> How about a _much_ simpler approach.
>
> Just make it do
>
> 	BEGIN { push ENV{'GIT_PERL_EXEC_DIR'}; }
>
> And then simply _require_ that the setup code sets up GIT_PERL_EXEC_DIR.

No, we are not mucking with /usr/bin but are talking about a
directory for platform specific Perl libraries, which we need to
ask Perl at build-time.

And the standard way to say that is to do:

	use lib '@@INSTLIBDIR@@';

but that always prepends the directory to the search path, and
the ugly stuff is to allow test scripts to override it when
needed.

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

* Re: Making perl scripts include the correct Git.pm
  2006-07-03  0:02 ` Junio C Hamano
  2006-06-28  0:23   ` Quick merge status updates Junio C Hamano
@ 2006-07-03  1:38   ` Junio C Hamano
  2006-07-04 19:01     ` Marco Costalba
  1 sibling, 1 reply; 27+ messages in thread
From: Junio C Hamano @ 2006-07-03  1:38 UTC (permalink / raw)
  To: Petr Baudis; +Cc: git

Junio C Hamano <junkio@cox.net> writes:

> Petr Baudis <pasky@suse.cz> writes:
>
>> so this is my attempt to summarize it:
>
> Ah, our message crossed -- thanks for summarizing it.  I do not
> particularly like any of the solution so far, but maybe the
> patch I just sent out to "do the normal thing unless we are
> running tests" might be the right thing to do.

I see you caught Merlyn so I decided the patch I sent earlier as
a tentative fix and merged the series in "next".  We should be
able to fix Perly problems in-tree while we have his attention
;-).

Rene's merge-bases fix is also in "next".  Hopefully this would
make merge-recursive work by Alex and Johannes go smoother?

On the other front, I applied the --remove-empty --parents fix
by Linus to "master".  Since this broke gitk and qgit it might
warrant a 1.4.1.1 hotfix.

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

* Re: Quick merge status updates.
  2006-07-02 23:49                   ` Junio C Hamano
  2006-07-03  0:00                     ` Linus Torvalds
@ 2006-07-03 20:29                     ` Petr Baudis
  2006-07-03 21:16                       ` [PATCH] Use $GITPERLLIB instead of $RUNNING_GIT_TESTS and centralize @INC munging Petr Baudis
  1 sibling, 1 reply; 27+ messages in thread
From: Petr Baudis @ 2006-07-03 20:29 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Dear diary, on Mon, Jul 03, 2006 at 02:02:30AM CEST, I got a letter
where Junio C Hamano <junkio@cox.net> said that...
> Petr Baudis <pasky@suse.cz> writes:
> 
> > so this is my attempt to summarize it:
> 
> Ah, our message crossed -- thanks for summarizing it.  I do not
> particularly like any of the solution so far, but maybe the
> patch I just sent out to "do the normal thing unless we are
> running tests" might be the right thing to do.

Yes, I roughly agree. I have some gripes, patches will follow.

> >   (ii) My proposed second solution was to add an autogenerated line to
> > the Git's perl scripts saying something like:
> >
> > 	use lib ('instlibdir', 'srclibdir');
> >
> > This fulfills all (D1), (D2) and (D3)
> 
> If you have srclibdir after instlibdir, aren't you breaking D2?

*Sigh*

Why can't I get it right for once? ;-)

> And I do not think swapping them is right either.  It would
> fullfil D1/D2/D3 but I think it has one bad side effect.

Yes, I agree with your reservations.

-- 
				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] 27+ messages in thread

* [PATCH] Use $GITPERLLIB instead of $RUNNING_GIT_TESTS and centralize @INC munging
  2006-07-03 20:29                     ` Petr Baudis
@ 2006-07-03 21:16                       ` Petr Baudis
  0 siblings, 0 replies; 27+ messages in thread
From: Petr Baudis @ 2006-07-03 21:16 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

This makes the Git perl scripts check $GITPERLLIB instead of
$RUNNING_GIT_TESTS, which makes more sense if you are setting up your shell
environment to use a non-installed Git instance.

It also weeds out the @INC munging from the individual scripts and makes
Makefile add it during the .perl files processing, so that we can change
just a single place when we modify this shared logic. It looks ugly in the
scripts, too. ;-)

And instead of doing arcane things with the @INC array, we just do 'use lib'
instead, which is essentialy the same thing anyway.

I first want to do three separate patches but it turned out that it's quite
a lot neater when bundled together, so I hope it's ok.

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

 INSTALL                |    4 ++--
 Makefile               |    4 +++-
 git-fmt-merge-msg.perl |    5 -----
 git-mv.perl            |    5 -----
 t/test-lib.sh          |    5 ++---
 5 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/INSTALL b/INSTALL
index ed502de..4e8f883 100644
--- a/INSTALL
+++ b/INSTALL
@@ -39,8 +39,8 @@ Issues of note:
 
 	GIT_EXEC_PATH=`pwd`
 	PATH=`pwd`:$PATH
-	PERL5LIB=`pwd`/perl/blib/lib:`pwd`/perl/blib/arch/auto/Git
-	export GIT_EXEC_PATH PATH PERL5LIB
+	GITPERLLIB=`pwd`/perl/blib/lib:`pwd`/perl/blib/arch/auto/Git
+	export GIT_EXEC_PATH PATH GITPERLLIB
 
  - Git is reasonably self-sufficient, but does depend on a few external
    programs and libraries:
diff --git a/Makefile b/Makefile
index a62e8a3..bae95c2 100644
--- a/Makefile
+++ b/Makefile
@@ -552,7 +552,9 @@ common-cmds.h: Documentation/git-*.txt
 $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl
 	rm -f $@ $@+
 	INSTLIBDIR=`$(MAKE) -C perl -s --no-print-directory instlibdir` && \
-	sed -e '1s|#!.*perl\(.*\)|#!$(PERL_PATH_SQ)\1|' \
+	sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|1' \
+	    -e '2i\
+	        use lib (split(/:/, $$ENV{GITPERLLIB} || '\'"$$INSTLIBDIR"\''));' \
 	    -e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \
 	    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
 	    $@.perl >$@+
diff --git a/git-fmt-merge-msg.perl b/git-fmt-merge-msg.perl
index a9805dd..f86231e 100755
--- a/git-fmt-merge-msg.perl
+++ b/git-fmt-merge-msg.perl
@@ -5,11 +5,6 @@ #
 # Read .git/FETCH_HEAD and make a human readable merge message
 # by grouping branches and tags together to form a single line.
 
-BEGIN {
-	unless (exists $ENV{'RUNNING_GIT_TESTS'}) {
-		unshift @INC, '@@INSTLIBDIR@@';
-	}
-}
 use strict;
 use Git;
 use Error qw(:try);
diff --git a/git-mv.perl b/git-mv.perl
index 5134b80..322b9fd 100755
--- a/git-mv.perl
+++ b/git-mv.perl
@@ -6,11 +6,6 @@ #
 # This file is licensed under the GPL v2, or a later version
 # at the discretion of Linus Torvalds.
 
-BEGIN {
-	unless (exists $ENV{'RUNNING_GIT_TESTS'}) {
-		unshift @INC, '@@INSTLIBDIR@@';
-	}
-}
 use warnings;
 use strict;
 use Getopt::Std;
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 298c6ca..ad9796e 100755
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -206,9 +206,8 @@ PYTHON=`sed -e '1{
 	PYTHONPATH=$(pwd)/../compat
 	export PYTHONPATH
 }
-RUNNING_GIT_TESTS=YesWeAre
-PERL5LIB=$(pwd)/../perl/blib/lib:$(pwd)/../perl/blib/arch/auto/Git
-export PERL5LIB RUNNING_GIT_TESTS
+GITPERLLIB=$(pwd)/../perl/blib/lib:$(pwd)/../perl/blib/arch/auto/Git
+export GITPERLLIB
 test -d ../templates/blt || {
 	error "You haven't built things yet, have you?"
 }

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

* Re: Making perl scripts include the correct Git.pm
  2006-07-03  1:38   ` Making perl scripts include the correct Git.pm Junio C Hamano
@ 2006-07-04 19:01     ` Marco Costalba
  0 siblings, 0 replies; 27+ messages in thread
From: Marco Costalba @ 2006-07-04 19:01 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Petr Baudis, git

On 7/3/06, Junio C Hamano <junkio@cox.net> wrote:
> Junio C Hamano <junkio@cox.net> writes:
>
> On the other front, I applied the --remove-empty --parents fix
> by Linus to "master".  Since this broke gitk and qgit it might
> warrant a 1.4.1.1 hotfix.
>

Well on the qgit side the bug is plus or less harmless, you see some
spurious revisions in file annotation history and a warning message on
stderr, but not a show stopper.

    Marco

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

* Re: Quick merge status updates.
  2006-07-02 20:49           ` Petr Baudis
  2006-07-02 21:33             ` Junio C Hamano
@ 2006-07-08  7:36             ` Pavel Roskin
  1 sibling, 0 replies; 27+ messages in thread
From: Pavel Roskin @ 2006-07-08  7:36 UTC (permalink / raw)
  To: Petr Baudis; +Cc: Junio C Hamano, git

On Sun, 2006-07-02 at 22:49 +0200, Petr Baudis wrote:
> Dear diary, on Wed, Jun 28, 2006 at 12:05:03PM CEST, I got a letter
> where Pavel Roskin <proski@gnu.org> said that...

> I feel that it is time for another stupid question of mine - why can't
> you just use lib?
> 
> 	use lib ('@@INSTLIBDIR@@');
> 
> Looks a lot better than some @INC unshifting, and it should be
> equivalent.

I honestly have no idea.  I think whatever gets you closer to the
satisfaction of the "three conditions" should be used.

-- 
Regards,
Pavel Roskin

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

end of thread, other threads:[~2006-07-08  7:36 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-02 21:40 Making perl scripts include the correct Git.pm Petr Baudis
2006-07-03  0:02 ` Junio C Hamano
2006-06-28  0:23   ` Quick merge status updates Junio C Hamano
2006-06-28  5:04     ` Pavel Roskin
2006-06-28  8:49       ` Junio C Hamano
2006-06-28 10:05         ` Pavel Roskin
2006-06-28 10:14           ` Junio C Hamano
2006-07-02 20:49           ` Petr Baudis
2006-07-02 21:33             ` Junio C Hamano
2006-07-02 21:49               ` Petr Baudis
2006-07-02 22:50                 ` Junio C Hamano
2006-07-02 23:49                   ` Junio C Hamano
2006-07-03  0:00                     ` Linus Torvalds
2006-07-03  0:06                       ` Junio C Hamano
2006-07-03 20:29                     ` Petr Baudis
2006-07-03 21:16                       ` [PATCH] Use $GITPERLLIB instead of $RUNNING_GIT_TESTS and centralize @INC munging Petr Baudis
2006-07-08  7:36             ` Quick merge status updates Pavel Roskin
2006-06-28  7:32     ` Johannes Schindelin
2006-06-28  7:39       ` Johannes Schindelin
2006-06-28  8:51         ` Junio C Hamano
2006-06-28  9:13           ` Johannes Schindelin
2006-07-01 23:48         ` [PATCH] Git.pm: Avoid ppport.h Petr Baudis
2006-07-02  9:52           ` Johannes Schindelin
2006-07-02 19:05             ` Junio C Hamano
2006-07-02 20:57               ` [PATCH] Git.pm: Don't #define around die Petr Baudis
2006-07-03  1:38   ` Making perl scripts include the correct Git.pm Junio C Hamano
2006-07-04 19:01     ` Marco Costalba

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).