git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Quick merge status updates.

From
Petr Baudis <pasky@suse.cz>
Date
Jul 2, 2006, 20:49 UTC
Message-ID
<20060702204906.GG29115@pasky.or.cz>
In-Reply-To
<1151489103.28036.6.camel@dv>

Dear diary, on Wed, Jun 28, 2006 at 12:05:03PM CEST, I got a letter where Pavel Roskin <proski@gnu.org> said that...

Show 18 quoted lines
> 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
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 21 in “Quick merge status updates.”
  1. Junio C HamanoJun 28, 2006
  2. Pavel RoskinJun 28, 2006
  3. Junio C HamanoJun 28, 2006
  4. Pavel RoskinJun 28, 2006
  5. Junio C HamanoJun 28, 2006
  6. Petr BaudisJul 2, 2006
  7. Junio C HamanoJul 2, 2006
  8. Petr BaudisJul 2, 2006
  9. Junio C HamanoJul 2, 2006
  10. Junio C HamanoJul 2, 2006
  11. Linus TorvaldsJul 3, 2006
  12. Junio C HamanoJul 3, 2006
  13. Pavel RoskinJul 8, 2006
  14. Johannes SchindelinJun 28, 2006
  15. Johannes SchindelinJun 28, 2006
  16. Junio C HamanoJun 28, 2006
  17. Johannes SchindelinJun 28, 2006
  18. Git.pm: Avoid ppport.hPetr Baudis, Jul 1, 2006
  19. Johannes SchindelinJul 2, 2006
  20. Junio C HamanoJul 2, 2006
  21. Git.pm: Don't #define around diePetr Baudis, Jul 2, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.