Subject: Re: [PATCH] gitweb-lib.sh: Set up PATH to use perl from /usr/bin

From: Zbigniew Jędrzejewski-Szmek <[email-masked]>
Date: Tue, 01 May 2012 19:03:39 +0200

On 05/01/2012 06:47 PM, Junio C Hamano wrote:
> Zbigniew Jędrzejewski-Szmek  <[email-masked]> writes:
> 
>> Hm, I see that most scripts have #!/usr/bin/perl, and only two have
>> #!env perl [1]. So in general we usally rely on using perl in /usr/bin.
> 
> The #!/usr/bin/env variants should be eradicated.  Our Makefile rewrites
> "#!.*perl" with "#!$PERL_PATH" in scripted Porcelains before installing,
> so /usr/bin/perl is the right thing to write there.
This would be trivial, as it is only two files.

But I don't see why we would use a different perl in
git-am.sh:                      perl -ne 'BEGIN { $subject = 0 }
git-am.sh:                      perl -M'POSIX qw(strftime)' -ne 'BEGIN { $subject = 0 }
git-request-pull.sh:ref=$(git ls-remote "$url" | perl -e "$find_matching_ref" "$head" "$headrev")
git-submodule.sh:       perl -e '
test-sha1.sh:                   perl -pe 'y/\000/g/'
test-sha1.sh:                   perl -pe 'y/\000/g/'
and lot of files in t/. Shouldn't those be replaced too?

Jeff King wrote:
> The Makefile substitutes $PERL_PATH on the #!-line of each perl script
> during its "build" step (which is really just copying the file to its
> final name and running "chmod +x").
Thank you for the explanation. I never noticed this, since I don't set
PERL_PATH myself.

Zbyszek