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

Re: [PATCH] perl shebangs: Use /usr/bin/env, not /usr/bin/perl

From
Randal L. Schwartz <merlyn@stonehenge.com>
Date
May 21, 2010, 15:32 UTC
Message-ID
<86tyq1gti2.fsf@red.stonehenge.com>
In-Reply-To
<1274454086-2312-1-git-send-email-avarab@gmail.com>
>>>>> "Ævar" == Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

Ævar> Change the Perl Git utilities to use #!/usr/bin/env perl as a shebang Ævar> instead of #!/usr/bin/perl. This makes e.g. git-send-email work if Ævar> your personal perl has Net::SMTP::SSL, but your system perl Ævar> doesn't.

Not a good idea in general.

Ævar> With this change all the code in Git that uses a shebang now uses Ævar> /usr/bin/env, except those things that use /bin/sh and /bin/bash. All Ævar> the Python code already used it, and some of the Perl code.

Sorry I didn't catch this earlier then.

I often have an "experimental" Perl earlier in my path than the "official" Perl. This would mean that I'd get different behaviors running git from the command line than I would from automated tools, and it would be relatively confusing.

The official Perl should be in /usr/bin or /usr/local/bin, and that's the one you should use with Git. *Or*, give the installer a knob to configure.

But please don't use env. Heck, some systems might not even *have* env. And some systems have it in /bin and not /usr/bin. Don't ruin portablity at this point, please.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
Previous: Tor ArntsenNext: Jeff King
Message 7 of 10 in “perl libs: perl -w + use warnings is redundant”
  1. perl libs: perl -w + use warnings is redundantÆvar Arnfjörð Bjarmason, May 21, 2010
  2. perl shebangs: Use /usr/bin/env, not /usr/bin/perlÆvar Arnfjörð Bjarmason, May 21, 2010
  3. Peter KjellerstedtMay 21, 2010
  4. Ævar Arnfjörð BjarmasonMay 21, 2010
  5. perl shebangs: Use /usr/bin/env, not /usr/bin/perlÆvar Arnfjörð Bjarmason, May 21, 2010
  6. Tor ArntsenMay 21, 2010
  7. Randal L. SchwartzMay 21, 2010
  8. Jeff KingMay 21, 2010
  9. 1/2 perl libs: perl -w + use warnings is redundantÆvar Arnfjörð Bjarmason, May 21, 2010
  10. Ævar Arnfjörð BjarmasonMay 21, 2010

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.