{"thread":{"id":"23868","subject":"[PATCH] perl libs: perl -w + use warnings is redundant","startedAt":"2010-05-21T14:50:55Z","lastAt":"2010-05-21T16:55:56Z","messageCount":10,"participants":["Ævar Arnfjörð Bjarmason","Peter Kjellerstedt","Tor Arntsen","Randal L. Schwartz","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"142033","messageId":"1274453455-1941-1-git-send-email-avarab@gmail.com","threadId":"23868","inReplyTo":null,"subject":"[PATCH] perl libs: perl -w + use warnings is redundant","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-05-21T14:50:55Z","receivedAt":"2010-05-21T14:50:55Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the Perl scripts to turn on lexical warnings, but only in Perl\nscripts that definitely require 5.6.0 or later. I.e. those that either\ndid 'use warnings' in addition to -w already, or used the three-arg\nform of open.\n\n-w sets warnings for all code that interpreter runs. \"use warnings\" is\nlexically scoped. The former is probably not what the authors wanted.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n contrib/examples/git-svnimport.perl         |    2 +-\n contrib/fast-import/import-directories.perl |    3 ++-\n git-add--interactive.perl                   |    3 ++-\n git-archimport.perl                         |    2 +-\n git-send-email.perl                         |    2 +-\n 5 files changed, 7 insertions(+), 5 deletions(-)\n\ndiff --git a/contrib/examples/git-svnimport.perl b/contrib/examples/git-svnimport.perl\nindex 4576c4a..ead4c04 100755\n--- a/contrib/examples/git-svnimport.perl\n+++ b/contrib/examples/git-svnimport.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/perl\n \n # This tool is copyright (c) 2005, Matthias Urlichs.\n # It is released under the Gnu Public License, version 2.\ndiff --git a/contrib/fast-import/import-directories.perl b/contrib/fast-import/import-directories.perl\nindex 3a5da4a..7f3afa5 100755\n--- a/contrib/fast-import/import-directories.perl\n+++ b/contrib/fast-import/import-directories.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/perl\n #\n # Copyright 2008-2009 Peter Krefting <peter@softwolves.pp.se>\n #\n@@ -140,6 +140,7 @@ by whitespace or other characters.\n \n # Globals\n use strict;\n+use warnings;\n use integer;\n my $crlfmode = 0;\n my @revs;\ndiff --git a/git-add--interactive.perl b/git-add--interactive.perl\nindex 21f1330..c2e7ab4 100755\n--- a/git-add--interactive.perl\n+++ b/git-add--interactive.perl\n@@ -1,6 +1,7 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/perl\n \n use strict;\n+use warnings;\n use Git;\n \n binmode(STDOUT, \":raw\");\ndiff --git a/git-archimport.perl b/git-archimport.perl\nindex 98f3ede..6ee3fca 100755\n--- a/git-archimport.perl\n+++ b/git-archimport.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/perl\n #\n # This tool is copyright (c) 2005, Martin Langhoff.\n # It is released under the Gnu Public License, version 2.\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 111c981..bbb03f7 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/perl\n #\n # Copyright 2002,2005 Greg Kroah-Hartman <greg@kroah.com>\n # Copyright 2005 Ryan Anderson <ryan@michonline.com>\n-- \n1.7.1.98.g4a5f\n"},{"id":"142036","messageId":"1274454086-2312-1-git-send-email-avarab@gmail.com","threadId":"23868","inReplyTo":"1274453455-1941-1-git-send-email-avarab@gmail.com","subject":"[PATCH] perl shebangs: Use /usr/bin/env, not /usr/bin/perl","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-05-21T15:01:26Z","receivedAt":"2010-05-21T15:01:26Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the Perl Git utilities to use #!/usr/bin/env perl as a shebang\ninstead of #!/usr/bin/perl. This makes e.g. git-send-email work if\nyour personal perl has Net::SMTP::SSL, but your system perl doesn't.\n\nThis only affects shebangs in the uninstalled source tree. On\ninstallation shebangs will still be munged to PERL_PATH, which is\ncurrently /usr/bin/perl by default.\n\nWith this change all the code in Git that uses a shebang now uses\n/usr/bin/env, except those things that use /bin/sh and /bin/bash. All\nthe Python code already used it, and some of the Perl code.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n\nThis should probably have been a series, not an individual patch since\nit depends on <1274453455-1941-1-git-send-email-avarab@gmail.com> to\napply. However the two are functionally independent. I can alter this\none so that it applies to the current master on request, but I'm\nguessing the \"perl libs: perl -w + use warnings is redundant\" patch is\nwanted anyway.\n\n Documentation/build-docdep.perl             |    2 +-\n Documentation/cat-texi.perl                 |    2 +-\n Documentation/cmd-list.perl                 |    2 +-\n Documentation/fix-texi.perl                 |    2 +-\n compat/vcbuild/scripts/clink.pl             |    2 +-\n compat/vcbuild/scripts/lib.pl               |    2 +-\n contrib/blameview/blameview.perl            |    2 +-\n contrib/buildsystems/engine.pl              |    2 +-\n contrib/buildsystems/generate               |    2 +-\n contrib/buildsystems/parse.pl               |    2 +-\n contrib/continuous/cidaemon                 |    2 +-\n contrib/continuous/post-receive-cinotify    |    2 +-\n contrib/examples/git-remote.perl            |    2 +-\n contrib/examples/git-rerere.perl            |    2 +-\n contrib/examples/git-svnimport.perl         |    2 +-\n contrib/fast-import/git-import.perl         |    2 +-\n contrib/fast-import/import-directories.perl |    2 +-\n contrib/fast-import/import-tars.perl        |    2 +-\n contrib/hooks/setgitperms.perl              |    2 +-\n contrib/hooks/update-paranoid               |    2 +-\n contrib/stats/mailmap.pl                    |    2 +-\n contrib/stats/packinfo.pl                   |    2 +-\n git-add--interactive.perl                   |    2 +-\n git-archimport.perl                         |    2 +-\n git-cvsexportcommit.perl                    |    2 +-\n git-cvsimport.perl                          |    2 +-\n git-cvsserver.perl                          |    2 +-\n git-send-email.perl                         |    2 +-\n gitweb/gitweb.perl                          |    2 +-\n t/gitweb-lib.sh                             |    2 +-\n t/t7006/test-terminal.perl                  |    2 +-\n t/t9138-git-svn-authors-prog.sh             |    2 +-\n t/t9700/test.pl                             |    2 +-\n 33 files changed, 33 insertions(+), 33 deletions(-)\n\ndiff --git a/Documentation/build-docdep.perl b/Documentation/build-docdep.perl\nindex ba4205e..dc50f21 100755\n--- a/Documentation/build-docdep.perl\n+++ b/Documentation/build-docdep.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n \n my %include = ();\n my %included = ();\ndiff --git a/Documentation/cat-texi.perl b/Documentation/cat-texi.perl\nindex 828ec62..d96d2f1 100755\n--- a/Documentation/cat-texi.perl\n+++ b/Documentation/cat-texi.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/env perl -w\n \n my @menu = ();\n my $output = $ARGV[0];\ndiff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl\nindex 04f9977..dfb9014 100755\n--- a/Documentation/cmd-list.perl\n+++ b/Documentation/cmd-list.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/env perl -w\n \n use File::Compare qw(compare);\n \ndiff --git a/Documentation/fix-texi.perl b/Documentation/fix-texi.perl\nindex ff7d78f..b87b3ba 100755\n--- a/Documentation/fix-texi.perl\n+++ b/Documentation/fix-texi.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/env perl -w\n \n while (<>) {\n \tif (/^\\@setfilename/) {\ndiff --git a/compat/vcbuild/scripts/clink.pl b/compat/vcbuild/scripts/clink.pl\nindex 4374771..a5f8d07 100644\n--- a/compat/vcbuild/scripts/clink.pl\n+++ b/compat/vcbuild/scripts/clink.pl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/env perl -w\n ######################################################################\n # Compiles or links files\n #\ndiff --git a/compat/vcbuild/scripts/lib.pl b/compat/vcbuild/scripts/lib.pl\nindex d8054e4..ee84781 100644\n--- a/compat/vcbuild/scripts/lib.pl\n+++ b/compat/vcbuild/scripts/lib.pl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/env perl -w\n ######################################################################\n # Libifies files on Windows\n #\ndiff --git a/contrib/blameview/blameview.perl b/contrib/blameview/blameview.perl\nindex 1dec001..438b737 100755\n--- a/contrib/blameview/blameview.perl\n+++ b/contrib/blameview/blameview.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n \n use Gtk2 -init;\n use Gtk2::SimpleList;\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex 23da787..286d40f 100644\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/env perl -w\n ######################################################################\n # Do not call this script directly!\n #\ndiff --git a/contrib/buildsystems/generate b/contrib/buildsystems/generate\nindex bc10f25..926eb77 100644\n--- a/contrib/buildsystems/generate\n+++ b/contrib/buildsystems/generate\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/env perl -w\n ######################################################################\n # Generate buildsystem files\n #\ndiff --git a/contrib/buildsystems/parse.pl b/contrib/buildsystems/parse.pl\nindex c9656ec..4dd9132 100644\n--- a/contrib/buildsystems/parse.pl\n+++ b/contrib/buildsystems/parse.pl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/env perl -w\n ######################################################################\n # Do not call this script directly!\n #\ndiff --git a/contrib/continuous/cidaemon b/contrib/continuous/cidaemon\nindex 4009a15..9f10ce5 100644\n--- a/contrib/continuous/cidaemon\n+++ b/contrib/continuous/cidaemon\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n #\n # A daemon that waits for update events sent by its companion\n # post-receive-cinotify hook, checks out a new copy of source,\ndiff --git a/contrib/continuous/post-receive-cinotify b/contrib/continuous/post-receive-cinotify\nindex b8f5a60..aeef222 100644\n--- a/contrib/continuous/post-receive-cinotify\n+++ b/contrib/continuous/post-receive-cinotify\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n #\n # A hook that notifies its companion cidaemon through a simple\n # queue file that a ref has been updated via a push (actually\ndiff --git a/contrib/examples/git-remote.perl b/contrib/examples/git-remote.perl\nindex b17952a..09db6f5 100755\n--- a/contrib/examples/git-remote.perl\n+++ b/contrib/examples/git-remote.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/env perl -w\n \n use strict;\n use Git;\ndiff --git a/contrib/examples/git-rerere.perl b/contrib/examples/git-rerere.perl\nindex 4f69209..110c27f 100755\n--- a/contrib/examples/git-rerere.perl\n+++ b/contrib/examples/git-rerere.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n #\n # REuse REcorded REsolve.  This tool records a conflicted automerge\n # result and its hand resolution, and helps to resolve future\ndiff --git a/contrib/examples/git-svnimport.perl b/contrib/examples/git-svnimport.perl\nindex ead4c04..c4ded33 100755\n--- a/contrib/examples/git-svnimport.perl\n+++ b/contrib/examples/git-svnimport.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n \n # This tool is copyright (c) 2005, Matthias Urlichs.\n # It is released under the Gnu Public License, version 2.\ndiff --git a/contrib/fast-import/git-import.perl b/contrib/fast-import/git-import.perl\nindex f9fef6d..275c3b9 100755\n--- a/contrib/fast-import/git-import.perl\n+++ b/contrib/fast-import/git-import.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n #\n # Performs an initial import of a directory. This is the equivalent\n # of doing 'git init; git add .; git commit'. It's a little slower,\ndiff --git a/contrib/fast-import/import-directories.perl b/contrib/fast-import/import-directories.perl\nindex 7f3afa5..a02daa8 100755\n--- a/contrib/fast-import/import-directories.perl\n+++ b/contrib/fast-import/import-directories.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n #\n # Copyright 2008-2009 Peter Krefting <peter@softwolves.pp.se>\n #\ndiff --git a/contrib/fast-import/import-tars.perl b/contrib/fast-import/import-tars.perl\nindex 95438e1..1b667e3 100755\n--- a/contrib/fast-import/import-tars.perl\n+++ b/contrib/fast-import/import-tars.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n \n ## tar archive frontend for git-fast-import\n ##\ndiff --git a/contrib/hooks/setgitperms.perl b/contrib/hooks/setgitperms.perl\nindex a577ad0..b33f094 100644\n--- a/contrib/hooks/setgitperms.perl\n+++ b/contrib/hooks/setgitperms.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n #\n # Copyright (c) 2006 Josh England\n #\ndiff --git a/contrib/hooks/update-paranoid b/contrib/hooks/update-paranoid\nindex d18b317..95595ac 100644\n--- a/contrib/hooks/update-paranoid\n+++ b/contrib/hooks/update-paranoid\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n \n use strict;\n use File::Spec;\ndiff --git a/contrib/stats/mailmap.pl b/contrib/stats/mailmap.pl\nindex 4b852e2..af92759 100755\n--- a/contrib/stats/mailmap.pl\n+++ b/contrib/stats/mailmap.pl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/env perl -w\n my %mailmap = ();\n open I, \"<\", \".mailmap\";\n while (<I>) {\ndiff --git a/contrib/stats/packinfo.pl b/contrib/stats/packinfo.pl\nindex be188c0..51823ac 100755\n--- a/contrib/stats/packinfo.pl\n+++ b/contrib/stats/packinfo.pl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n #\n # This tool will print vaguely pretty information about a pack.  It\n # expects the output of \"git verify-pack -v\" as input on stdin.\ndiff --git a/git-add--interactive.perl b/git-add--interactive.perl\nindex c2e7ab4..0826aab 100755\n--- a/git-add--interactive.perl\n+++ b/git-add--interactive.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n \n use strict;\n use warnings;\ndiff --git a/git-archimport.perl b/git-archimport.perl\nindex 6ee3fca..a5e79fd 100755\n--- a/git-archimport.perl\n+++ b/git-archimport.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n #\n # This tool is copyright (c) 2005, Martin Langhoff.\n # It is released under the Gnu Public License, version 2.\ndiff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl\nindex 59b6722..fac4c6f 100755\n--- a/git-cvsexportcommit.perl\n+++ b/git-cvsexportcommit.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/env perl -w\n \n use strict;\n use Getopt::Std;\ndiff --git a/git-cvsimport.perl b/git-cvsimport.perl\nindex 9e03eee..5470c81 100755\n--- a/git-cvsimport.perl\n+++ b/git-cvsimport.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/env perl -w\n \n # This tool is copyright (c) 2005, Matthias Urlichs.\n # It is released under the Gnu Public License, version 2.\ndiff --git a/git-cvsserver.perl b/git-cvsserver.perl\nindex 13751db..dc1c5dd 100755\n--- a/git-cvsserver.perl\n+++ b/git-cvsserver.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n \n ####\n #### This application is a CVS emulation layer for git.\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex bbb03f7..27bdca5 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n #\n # Copyright 2002,2005 Greg Kroah-Hartman <greg@kroah.com>\n # Copyright 2005 Ryan Anderson <ryan@michonline.com>\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 77e5f79..dbb0cc0 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n \n # gitweb - simple web interface to track changes in git repositories\n #\ndiff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh\nindex 5a734b1..9572c6a 100644\n--- a/t/gitweb-lib.sh\n+++ b/t/gitweb-lib.sh\n@@ -6,7 +6,7 @@\n gitweb_init () {\n \tsafe_pwd=\"$(perl -MPOSIX=getcwd -e 'print quotemeta(getcwd)')\"\n \tcat >gitweb_config.perl <<EOF\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n \n # gitweb configuration for tests\n \ndiff --git a/t/t7006/test-terminal.perl b/t/t7006/test-terminal.perl\nindex 73ff809..840bab7 100755\n--- a/t/t7006/test-terminal.perl\n+++ b/t/t7006/test-terminal.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n use strict;\n use warnings;\n use IO::Pty;\ndiff --git a/t/t9138-git-svn-authors-prog.sh b/t/t9138-git-svn-authors-prog.sh\nindex 83cc5fc..ac1dcd7 100755\n--- a/t/t9138-git-svn-authors-prog.sh\n+++ b/t/t9138-git-svn-authors-prog.sh\n@@ -8,7 +8,7 @@ test_description='git svn authors prog tests'\n . ./lib-git-svn.sh\n \n cat > svn-authors-prog <<'EOF'\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n $_ = shift;\n if (s/-sub$//)  {\n \tprint \"$_ <$_\\@sub.example.com>\\n\";\ndiff --git a/t/t9700/test.pl b/t/t9700/test.pl\nindex 666722d..abfc9ba 100755\n--- a/t/t9700/test.pl\n+++ b/t/t9700/test.pl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n use lib (split(/:/, $ENV{GITPERLLIB}));\n \n use 5.006002;\n-- \n1.7.1.98.g4a5f\n"},{"id":"142038","messageId":"A612847CFE53224C91B23E3A5B48BAC74483234EEB@xmail3.se.axis.com","threadId":"23868","inReplyTo":"1274454086-2312-1-git-send-email-avarab@gmail.com","subject":"RE: [PATCH] perl shebangs: Use /usr/bin/env, not /usr/bin/perl","fromName":"Peter Kjellerstedt","fromEmail":"peter.kjellerstedt@axis.com","sentAt":"2010-05-21T15:15:46Z","receivedAt":"2010-05-21T15:15:46Z","isPatch":true,"sender":{"key":"peter.kjellerstedt@axis.com","avatar":"https://gravatar.com/avatar/6d5a0182283c8eccd7b134a54dbfd5f30038f3ad4d38b96f424884b614a61ca2?d=mp&s=160"},"body":"> -----Original Message-----\n> From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On\n> Behalf Of Ævar Arnfjörð Bjarmason\n> Sent: den 21 maj 2010 17:01\n> To: git@vger.kernel.org\n> Cc: Junio C Hamano; Ævar Arnfjörð Bjarmason\n> Subject: [PATCH] perl shebangs: Use /usr/bin/env, not /usr/bin/perl\n> \n> Change the Perl Git utilities to use #!/usr/bin/env perl as a shebang\n> instead of #!/usr/bin/perl. This makes e.g. git-send-email work if\n> your personal perl has Net::SMTP::SSL, but your system perl doesn't.\n> \n> This only affects shebangs in the uninstalled source tree. On\n> installation shebangs will still be munged to PERL_PATH, which is\n> currently /usr/bin/perl by default.\n> \n> With this change all the code in Git that uses a shebang now uses\n> /usr/bin/env, except those things that use /bin/sh and /bin/bash. All\n> the Python code already used it, and some of the Perl code.\n> \n> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> ---\n> \n> This should probably have been a series, not an individual patch since\n> it depends on <1274453455-1941-1-git-send-email-avarab@gmail.com> to\n> apply. However the two are functionally independent. I can alter this\n> one so that it applies to the current master on request, but I'm\n> guessing the \"perl libs: perl -w + use warnings is redundant\" patch is\n> wanted anyway.\n> \n>  Documentation/build-docdep.perl             |    2 +-\n>  Documentation/cat-texi.perl                 |    2 +-\n>  Documentation/cmd-list.perl                 |    2 +-\n>  Documentation/fix-texi.perl                 |    2 +-\n>  compat/vcbuild/scripts/clink.pl             |    2 +-\n>  compat/vcbuild/scripts/lib.pl               |    2 +-\n>  contrib/blameview/blameview.perl            |    2 +-\n>  contrib/buildsystems/engine.pl              |    2 +-\n>  contrib/buildsystems/generate               |    2 +-\n>  contrib/buildsystems/parse.pl               |    2 +-\n>  contrib/continuous/cidaemon                 |    2 +-\n>  contrib/continuous/post-receive-cinotify    |    2 +-\n>  contrib/examples/git-remote.perl            |    2 +-\n>  contrib/examples/git-rerere.perl            |    2 +-\n>  contrib/examples/git-svnimport.perl         |    2 +-\n>  contrib/fast-import/git-import.perl         |    2 +-\n>  contrib/fast-import/import-directories.perl |    2 +-\n>  contrib/fast-import/import-tars.perl        |    2 +-\n>  contrib/hooks/setgitperms.perl              |    2 +-\n>  contrib/hooks/update-paranoid               |    2 +-\n>  contrib/stats/mailmap.pl                    |    2 +-\n>  contrib/stats/packinfo.pl                   |    2 +-\n>  git-add--interactive.perl                   |    2 +-\n>  git-archimport.perl                         |    2 +-\n>  git-cvsexportcommit.perl                    |    2 +-\n>  git-cvsimport.perl                          |    2 +-\n>  git-cvsserver.perl                          |    2 +-\n>  git-send-email.perl                         |    2 +-\n>  gitweb/gitweb.perl                          |    2 +-\n>  t/gitweb-lib.sh                             |    2 +-\n>  t/t7006/test-terminal.perl                  |    2 +-\n>  t/t9138-git-svn-authors-prog.sh             |    2 +-\n>  t/t9700/test.pl                             |    2 +-\n>  33 files changed, 33 insertions(+), 33 deletions(-)\n> \n> diff --git a/Documentation/build-docdep.perl b/Documentation/build-\n> docdep.perl\n> index ba4205e..dc50f21 100755\n> --- a/Documentation/build-docdep.perl\n> +++ b/Documentation/build-docdep.perl\n> @@ -1,4 +1,4 @@\n> -#!/usr/bin/perl\n> +#!/usr/bin/env perl\n> \n>  my %include = ();\n>  my %included = ();\n> diff --git a/Documentation/cat-texi.perl b/Documentation/cat-texi.perl\n> index 828ec62..d96d2f1 100755\n> --- a/Documentation/cat-texi.perl\n> +++ b/Documentation/cat-texi.perl\n> @@ -1,4 +1,4 @@\n> -#!/usr/bin/perl -w\n> +#!/usr/bin/env perl -w\n\nThis does not work. You cannot give arguments to an application \nstarted via /usr/bin/env; it will interprete everything after \n/usr/bin/env as the application name and fail with:\n\n/usr/bin/env: perl -w: No such file or directory\n\n//Peter\n\n"},{"id":"142040","messageId":"AANLkTinKPntmpqYXTADzivGic3HfeMEDm2f35N8Z7dMc@mail.gmail.com","threadId":"23868","inReplyTo":"A612847CFE53224C91B23E3A5B48BAC74483234EEB@xmail3.se.axis.com","subject":"Re: [PATCH] perl shebangs: Use /usr/bin/env, not /usr/bin/perl","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-05-21T15:22:14Z","receivedAt":"2010-05-21T15:22:14Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, May 21, 2010 at 15:15, Peter Kjellerstedt\n<peter.kjellerstedt@axis.com> wrote:\n> This does not work. You cannot give arguments to an application\n> started via /usr/bin/env; it will interprete everything after\n> /usr/bin/env as the application name and fail with:\n\nDoh'oh. You're right of course. I just tested it on the command-line\nand by executing the scripts (Perl interprets the shebang itself):\n\n    $ /usr/bin/env perl -w -le 'print $^W'\n    1\n\nHowever. Isn't Perl 5.6 the lowest version Git aspires to be\ncompatible with anyway? If that's the case they can just be changed to\n'use warnings' across the board.\n"},{"id":"142041","messageId":"AANLkTikGS4vjsjTj_hIClT_KEWhH1zaacyKhBM70Qgb6@mail.gmail.com","threadId":"23868","inReplyTo":"A612847CFE53224C91B23E3A5B48BAC74483234EEB@xmail3.se.axis.com","subject":"Re: [PATCH] perl shebangs: Use /usr/bin/env, not /usr/bin/perl","fromName":"Tor Arntsen","fromEmail":"tor@spacetec.no","sentAt":"2010-05-21T15:26:34Z","receivedAt":"2010-05-21T15:26:34Z","isPatch":true,"sender":{"key":"tor@spacetec.no","avatar":null},"body":"On Fri, May 21, 2010 at 17:15, Peter Kjellerstedt\n<peter.kjellerstedt@axis.com> wrote:\n> This does not work. You cannot give arguments to an application\n> started via /usr/bin/env; it will interprete everything after\n> /usr/bin/env as the application name and fail with:\n>\n> /usr/bin/env: perl -w: No such file or directory\n\nYep. It would have to be changed to\n/usr/bin/env perl\nand add\nBEGIN {$^W = 1;}\nto the script.\n\nThat been said, I've used /usr/bin/env perl for customer applications\nfor years and years, without problems.  Things wouldn't have worked\notherwise, because on e.g. IRIX systems the /usr/bin/perl version\nwould be 5.005 and the /usr/freeware version would be 5.6.1.BUt the\ncaveat is that you'll need to change -w to the above.\n\n-Tor\n"},{"id":"142043","messageId":"86tyq1gti2.fsf@red.stonehenge.com","threadId":"23868","inReplyTo":"1274454086-2312-1-git-send-email-avarab@gmail.com","subject":"Re: [PATCH] perl shebangs: Use /usr/bin/env, not /usr/bin/perl","fromName":"Randal L. Schwartz","fromEmail":"merlyn@stonehenge.com","sentAt":"2010-05-21T15:32:53Z","receivedAt":"2010-05-21T15:32:53Z","isPatch":true,"sender":{"key":"merlyn@stonehenge.com","avatar":"https://gravatar.com/avatar/dc528d210743ff0333e6213f9ee7b33b23f1b7bc1f3c5a8c2d819074ecd7ab19?d=mp&s=160"},"body":">>>>> \"Ævar\" == Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\nÆvar> Change the Perl Git utilities to use #!/usr/bin/env perl as a shebang\nÆvar> instead of #!/usr/bin/perl. This makes e.g. git-send-email work if\nÆvar> your personal perl has Net::SMTP::SSL, but your system perl\nÆvar> doesn't.\n\nNot a good idea in general.\n\nÆvar> With this change all the code in Git that uses a shebang now uses\nÆvar> /usr/bin/env, except those things that use /bin/sh and /bin/bash. All\nÆvar> the Python code already used it, and some of the Perl code.\n\nSorry I didn't catch this earlier then.\n\nI often have an \"experimental\" Perl earlier in my path than the\n\"official\" Perl.  This would mean that I'd get different behaviors\nrunning git from the command line than I would from automated tools, and\nit would be relatively confusing.\n\nThe official Perl should be in /usr/bin or /usr/local/bin, and that's\nthe one you should use with Git.  *Or*, give the installer a knob to\nconfigure.\n\nBut please don't use env.  Heck, some systems might not even *have*\nenv.  And some systems have it in /bin and not /usr/bin.  Don't ruin\nportablity at this point, please.\n\n-- \nRandal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095\n<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>\nSmalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.\nSee http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion\n"},{"id":"142049","messageId":"20100521160143.GA29031@sigill.intra.peff.net","threadId":"23868","inReplyTo":"86tyq1gti2.fsf@red.stonehenge.com","subject":"Re: [PATCH] perl shebangs: Use /usr/bin/env, not /usr/bin/perl","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-05-21T16:01:43Z","receivedAt":"2010-05-21T16:01:43Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, May 21, 2010 at 08:32:53AM -0700, Randal L. Schwartz wrote:\n\n> The official Perl should be in /usr/bin or /usr/local/bin, and that's\n> the one you should use with Git.  *Or*, give the installer a knob to\n> configure.\n\nDon't we already provide a knob? The Makefile has:\n\n  $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl\n  [...]\n          sed -e '1{' \\\n              -e '        s|#!.*perl|#!$(PERL_PATH_SQ)|' \\\n  [...]\n\nSo just setting PERL_PATH should be enough (from which PERL_PATH_SQ is\nderived).\n\n-Peff\n"},{"id":"142057","messageId":"1274460741-9674-1-git-send-email-avarab@gmail.com","threadId":"23868","inReplyTo":"1274453455-1941-1-git-send-email-avarab@gmail.com","subject":"[PATCH 1/2] perl libs: perl -w + use warnings is redundant","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-05-21T16:52:21Z","receivedAt":"2010-05-21T16:52:21Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the Perl scripts to turn on lexical warnings, but only in Perl\nscripts that definitely require 5.6.0 or later. I.e. those that either\ndid 'use warnings' in addition to -w already, or used the three-arg\nform of open.\n\n-w sets warnings for all code that interpreter runs. \"use warnings\" is\nlexically scoped. The former is probably not what the authors wanted.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n\nTurns out that I missed a case or two that could 'use\nwarnings'. I.e. used three-arg open.\n\n Documentation/cat-texi.perl                 |    3 ++-\n Documentation/cmd-list.perl                 |    4 ++--\n contrib/examples/git-remote.perl            |    3 ++-\n contrib/examples/git-svnimport.perl         |    2 +-\n contrib/fast-import/import-directories.perl |    3 ++-\n contrib/stats/mailmap.pl                    |    3 ++-\n git-add--interactive.perl                   |    3 ++-\n git-archimport.perl                         |    2 +-\n git-cvsimport.perl                          |    2 +-\n git-send-email.perl                         |    2 +-\n 10 files changed, 16 insertions(+), 11 deletions(-)\n\ndiff --git a/Documentation/cat-texi.perl b/Documentation/cat-texi.perl\nindex 828ec62..082978f 100755\n--- a/Documentation/cat-texi.perl\n+++ b/Documentation/cat-texi.perl\n@@ -1,4 +1,5 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/perl\n+use warnings;\n \n my @menu = ();\n my $output = $ARGV[0];\ndiff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl\nindex 04f9977..07d526e 100755\n--- a/Documentation/cmd-list.perl\n+++ b/Documentation/cmd-list.perl\n@@ -1,5 +1,5 @@\n-#!/usr/bin/perl -w\n-\n+#!/usr/bin/perl\n+use warnings;\n use File::Compare qw(compare);\n \n sub format_one {\ndiff --git a/contrib/examples/git-remote.perl b/contrib/examples/git-remote.perl\nindex b17952a..48ab0ef 100755\n--- a/contrib/examples/git-remote.perl\n+++ b/contrib/examples/git-remote.perl\n@@ -1,6 +1,7 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/perl\n \n use strict;\n+use warnings;\n use Git;\n my $git = Git->repository();\n \ndiff --git a/contrib/examples/git-svnimport.perl b/contrib/examples/git-svnimport.perl\nindex 4576c4a..ead4c04 100755\n--- a/contrib/examples/git-svnimport.perl\n+++ b/contrib/examples/git-svnimport.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/perl\n \n # This tool is copyright (c) 2005, Matthias Urlichs.\n # It is released under the Gnu Public License, version 2.\ndiff --git a/contrib/fast-import/import-directories.perl b/contrib/fast-import/import-directories.perl\nindex 3a5da4a..7f3afa5 100755\n--- a/contrib/fast-import/import-directories.perl\n+++ b/contrib/fast-import/import-directories.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/perl\n #\n # Copyright 2008-2009 Peter Krefting <peter@softwolves.pp.se>\n #\n@@ -140,6 +140,7 @@ by whitespace or other characters.\n \n # Globals\n use strict;\n+use warnings;\n use integer;\n my $crlfmode = 0;\n my @revs;\ndiff --git a/contrib/stats/mailmap.pl b/contrib/stats/mailmap.pl\nindex 4b852e2..ff296fa 100755\n--- a/contrib/stats/mailmap.pl\n+++ b/contrib/stats/mailmap.pl\n@@ -1,4 +1,5 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/perl\n+use warnings;\n my %mailmap = ();\n open I, \"<\", \".mailmap\";\n while (<I>) {\ndiff --git a/git-add--interactive.perl b/git-add--interactive.perl\nindex 21f1330..c2e7ab4 100755\n--- a/git-add--interactive.perl\n+++ b/git-add--interactive.perl\n@@ -1,6 +1,7 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/perl\n \n use strict;\n+use warnings;\n use Git;\n \n binmode(STDOUT, \":raw\");\ndiff --git a/git-archimport.perl b/git-archimport.perl\nindex 98f3ede..6ee3fca 100755\n--- a/git-archimport.perl\n+++ b/git-archimport.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/perl\n #\n # This tool is copyright (c) 2005, Martin Langhoff.\n # It is released under the Gnu Public License, version 2.\ndiff --git a/git-cvsimport.perl b/git-cvsimport.perl\nindex 9e03eee..d5e5677 100755\n--- a/git-cvsimport.perl\n+++ b/git-cvsimport.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/perl\n \n # This tool is copyright (c) 2005, Matthias Urlichs.\n # It is released under the Gnu Public License, version 2.\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 111c981..bbb03f7 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/perl\n #\n # Copyright 2002,2005 Greg Kroah-Hartman <greg@kroah.com>\n # Copyright 2005 Ryan Anderson <ryan@michonline.com>\n-- \n1.7.1.98.g4a5f\n"},{"id":"142059","messageId":"1274460855-9769-1-git-send-email-avarab@gmail.com","threadId":"23868","inReplyTo":"AANLkTinKPntmpqYXTADzivGic3HfeMEDm2f35N8Z7dMc@mail.gmail.com","subject":"[PATCH v2] perl shebangs: Use /usr/bin/env, not /usr/bin/perl","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-05-21T16:54:15Z","receivedAt":"2010-05-21T16:54:15Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the Perl Git utilities to use #!/usr/bin/env perl as a shebang\ninstead of #!/usr/bin/perl. In cases where perl -w was part of the\nshebang I've replaced it with BEGIN { $^W = 0 }. use warnings would be\nbetter, but this doesn't break systems still running perl 5.005.\n\nThis only affects shebangs in the uninstalled source tree. On\ninstallation shebangs will still be munged to PERL_PATH, which is\ncurrently /usr/bin/perl by default.\n\nWith this change all the code in Git that uses a shebang now uses\n/usr/bin/env, except those things that use /bin/sh and /bin/bash. All\nthe Python code already used it, and some of the Perl code.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n\nReplaces /usr/bin/env perl -w with just perl + BEGIN { $^W = 1 } which\nhas the same effect as -w. I.e. turns on warnings globally.\n\n Documentation/build-docdep.perl             |    2 +-\n Documentation/cat-texi.perl                 |    2 +-\n Documentation/cmd-list.perl                 |    4 ++--\n Documentation/fix-texi.perl                 |    3 ++-\n compat/vcbuild/scripts/clink.pl             |    3 ++-\n compat/vcbuild/scripts/lib.pl               |    3 ++-\n contrib/blameview/blameview.perl            |    2 +-\n contrib/buildsystems/engine.pl              |    3 ++-\n contrib/buildsystems/generate               |    3 ++-\n contrib/buildsystems/parse.pl               |    3 ++-\n contrib/continuous/cidaemon                 |    2 +-\n contrib/continuous/post-receive-cinotify    |    2 +-\n contrib/examples/git-remote.perl            |    2 +-\n contrib/examples/git-rerere.perl            |    2 +-\n contrib/examples/git-svnimport.perl         |    2 +-\n contrib/fast-import/git-import.perl         |    2 +-\n contrib/fast-import/import-directories.perl |    2 +-\n contrib/fast-import/import-tars.perl        |    2 +-\n contrib/hooks/setgitperms.perl              |    2 +-\n contrib/hooks/update-paranoid               |    2 +-\n contrib/stats/mailmap.pl                    |    3 +--\n contrib/stats/packinfo.pl                   |    2 +-\n git-add--interactive.perl                   |    2 +-\n git-archimport.perl                         |    2 +-\n git-cvsexportcommit.perl                    |    4 ++--\n git-cvsimport.perl                          |    2 +-\n git-cvsserver.perl                          |    2 +-\n git-send-email.perl                         |    2 +-\n gitweb/gitweb.perl                          |    2 +-\n t/gitweb-lib.sh                             |    2 +-\n t/t7006/test-terminal.perl                  |    2 +-\n t/t9138-git-svn-authors-prog.sh             |    2 +-\n t/t9700/test.pl                             |    2 +-\n 33 files changed, 41 insertions(+), 36 deletions(-)\n\ndiff --git a/Documentation/build-docdep.perl b/Documentation/build-docdep.perl\nindex ba4205e..dc50f21 100755\n--- a/Documentation/build-docdep.perl\n+++ b/Documentation/build-docdep.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n \n my %include = ();\n my %included = ();\ndiff --git a/Documentation/cat-texi.perl b/Documentation/cat-texi.perl\nindex 082978f..3b4fb2d 100755\n--- a/Documentation/cat-texi.perl\n+++ b/Documentation/cat-texi.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n use warnings;\n \n my @menu = ();\ndiff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl\nindex 07d526e..dfb9014 100755\n--- a/Documentation/cmd-list.perl\n+++ b/Documentation/cmd-list.perl\n@@ -1,5 +1,5 @@\n-#!/usr/bin/perl\n-use warnings;\n+#!/usr/bin/env perl -w\n+\n use File::Compare qw(compare);\n \n sub format_one {\ndiff --git a/Documentation/fix-texi.perl b/Documentation/fix-texi.perl\nindex ff7d78f..bd5b6dd 100755\n--- a/Documentation/fix-texi.perl\n+++ b/Documentation/fix-texi.perl\n@@ -1,4 +1,5 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/env perl\n+BEGIN { $^W = 1 }\n \n while (<>) {\n \tif (/^\\@setfilename/) {\ndiff --git a/compat/vcbuild/scripts/clink.pl b/compat/vcbuild/scripts/clink.pl\nindex 4374771..748e659 100644\n--- a/compat/vcbuild/scripts/clink.pl\n+++ b/compat/vcbuild/scripts/clink.pl\n@@ -1,4 +1,5 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/env perl\n+BEGIN { $^W = 1 }\n ######################################################################\n # Compiles or links files\n #\ndiff --git a/compat/vcbuild/scripts/lib.pl b/compat/vcbuild/scripts/lib.pl\nindex d8054e4..86b8977 100644\n--- a/compat/vcbuild/scripts/lib.pl\n+++ b/compat/vcbuild/scripts/lib.pl\n@@ -1,4 +1,5 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/env perl\n+BEGIN { $^W = 1 }\n ######################################################################\n # Libifies files on Windows\n #\ndiff --git a/contrib/blameview/blameview.perl b/contrib/blameview/blameview.perl\nindex 1dec001..438b737 100755\n--- a/contrib/blameview/blameview.perl\n+++ b/contrib/blameview/blameview.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n \n use Gtk2 -init;\n use Gtk2::SimpleList;\ndiff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl\nindex 23da787..ad4b82c 100644\n--- a/contrib/buildsystems/engine.pl\n+++ b/contrib/buildsystems/engine.pl\n@@ -1,4 +1,5 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/env perl\n+BEGIN { $^W = 1 }\n ######################################################################\n # Do not call this script directly!\n #\ndiff --git a/contrib/buildsystems/generate b/contrib/buildsystems/generate\nindex bc10f25..e3a352f 100644\n--- a/contrib/buildsystems/generate\n+++ b/contrib/buildsystems/generate\n@@ -1,4 +1,5 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/env perl\n+BEGIN { $^W = 1 }\n ######################################################################\n # Generate buildsystem files\n #\ndiff --git a/contrib/buildsystems/parse.pl b/contrib/buildsystems/parse.pl\nindex c9656ec..4f932a9 100644\n--- a/contrib/buildsystems/parse.pl\n+++ b/contrib/buildsystems/parse.pl\n@@ -1,4 +1,5 @@\n-#!/usr/bin/perl -w\n+#!/usr/bin/env perl\n+BEGIN { $^W = 1 }\n ######################################################################\n # Do not call this script directly!\n #\ndiff --git a/contrib/continuous/cidaemon b/contrib/continuous/cidaemon\nindex 4009a15..9f10ce5 100644\n--- a/contrib/continuous/cidaemon\n+++ b/contrib/continuous/cidaemon\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n #\n # A daemon that waits for update events sent by its companion\n # post-receive-cinotify hook, checks out a new copy of source,\ndiff --git a/contrib/continuous/post-receive-cinotify b/contrib/continuous/post-receive-cinotify\nindex b8f5a60..aeef222 100644\n--- a/contrib/continuous/post-receive-cinotify\n+++ b/contrib/continuous/post-receive-cinotify\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n #\n # A hook that notifies its companion cidaemon through a simple\n # queue file that a ref has been updated via a push (actually\ndiff --git a/contrib/examples/git-remote.perl b/contrib/examples/git-remote.perl\nindex 48ab0ef..ee050a6 100755\n--- a/contrib/examples/git-remote.perl\n+++ b/contrib/examples/git-remote.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl -w\n \n use strict;\n use warnings;\ndiff --git a/contrib/examples/git-rerere.perl b/contrib/examples/git-rerere.perl\nindex 4f69209..110c27f 100755\n--- a/contrib/examples/git-rerere.perl\n+++ b/contrib/examples/git-rerere.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n #\n # REuse REcorded REsolve.  This tool records a conflicted automerge\n # result and its hand resolution, and helps to resolve future\ndiff --git a/contrib/examples/git-svnimport.perl b/contrib/examples/git-svnimport.perl\nindex ead4c04..c4ded33 100755\n--- a/contrib/examples/git-svnimport.perl\n+++ b/contrib/examples/git-svnimport.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n \n # This tool is copyright (c) 2005, Matthias Urlichs.\n # It is released under the Gnu Public License, version 2.\ndiff --git a/contrib/fast-import/git-import.perl b/contrib/fast-import/git-import.perl\nindex f9fef6d..275c3b9 100755\n--- a/contrib/fast-import/git-import.perl\n+++ b/contrib/fast-import/git-import.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n #\n # Performs an initial import of a directory. This is the equivalent\n # of doing 'git init; git add .; git commit'. It's a little slower,\ndiff --git a/contrib/fast-import/import-directories.perl b/contrib/fast-import/import-directories.perl\nindex 7f3afa5..a02daa8 100755\n--- a/contrib/fast-import/import-directories.perl\n+++ b/contrib/fast-import/import-directories.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n #\n # Copyright 2008-2009 Peter Krefting <peter@softwolves.pp.se>\n #\ndiff --git a/contrib/fast-import/import-tars.perl b/contrib/fast-import/import-tars.perl\nindex 95438e1..1b667e3 100755\n--- a/contrib/fast-import/import-tars.perl\n+++ b/contrib/fast-import/import-tars.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n \n ## tar archive frontend for git-fast-import\n ##\ndiff --git a/contrib/hooks/setgitperms.perl b/contrib/hooks/setgitperms.perl\nindex a577ad0..b33f094 100644\n--- a/contrib/hooks/setgitperms.perl\n+++ b/contrib/hooks/setgitperms.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n #\n # Copyright (c) 2006 Josh England\n #\ndiff --git a/contrib/hooks/update-paranoid b/contrib/hooks/update-paranoid\nindex d18b317..95595ac 100644\n--- a/contrib/hooks/update-paranoid\n+++ b/contrib/hooks/update-paranoid\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n \n use strict;\n use File::Spec;\ndiff --git a/contrib/stats/mailmap.pl b/contrib/stats/mailmap.pl\nindex ff296fa..af92759 100755\n--- a/contrib/stats/mailmap.pl\n+++ b/contrib/stats/mailmap.pl\n@@ -1,5 +1,4 @@\n-#!/usr/bin/perl\n-use warnings;\n+#!/usr/bin/env perl -w\n my %mailmap = ();\n open I, \"<\", \".mailmap\";\n while (<I>) {\ndiff --git a/contrib/stats/packinfo.pl b/contrib/stats/packinfo.pl\nindex be188c0..51823ac 100755\n--- a/contrib/stats/packinfo.pl\n+++ b/contrib/stats/packinfo.pl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n #\n # This tool will print vaguely pretty information about a pack.  It\n # expects the output of \"git verify-pack -v\" as input on stdin.\ndiff --git a/git-add--interactive.perl b/git-add--interactive.perl\nindex c2e7ab4..0826aab 100755\n--- a/git-add--interactive.perl\n+++ b/git-add--interactive.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n \n use strict;\n use warnings;\ndiff --git a/git-archimport.perl b/git-archimport.perl\nindex 6ee3fca..a5e79fd 100755\n--- a/git-archimport.perl\n+++ b/git-archimport.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n #\n # This tool is copyright (c) 2005, Martin Langhoff.\n # It is released under the Gnu Public License, version 2.\ndiff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl\nindex 59b6722..a707f5c 100755\n--- a/git-cvsexportcommit.perl\n+++ b/git-cvsexportcommit.perl\n@@ -1,5 +1,5 @@\n-#!/usr/bin/perl -w\n-\n+#!/usr/bin/env perl\n+BEGIN { $^W = 1 }\n use strict;\n use Getopt::Std;\n use File::Temp qw(tempdir);\ndiff --git a/git-cvsimport.perl b/git-cvsimport.perl\nindex d5e5677..5470c81 100755\n--- a/git-cvsimport.perl\n+++ b/git-cvsimport.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl -w\n \n # This tool is copyright (c) 2005, Matthias Urlichs.\n # It is released under the Gnu Public License, version 2.\ndiff --git a/git-cvsserver.perl b/git-cvsserver.perl\nindex 13751db..dc1c5dd 100755\n--- a/git-cvsserver.perl\n+++ b/git-cvsserver.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n \n ####\n #### This application is a CVS emulation layer for git.\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex bbb03f7..27bdca5 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n #\n # Copyright 2002,2005 Greg Kroah-Hartman <greg@kroah.com>\n # Copyright 2005 Ryan Anderson <ryan@michonline.com>\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 77e5f79..dbb0cc0 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n \n # gitweb - simple web interface to track changes in git repositories\n #\ndiff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh\nindex 5a734b1..9572c6a 100644\n--- a/t/gitweb-lib.sh\n+++ b/t/gitweb-lib.sh\n@@ -6,7 +6,7 @@\n gitweb_init () {\n \tsafe_pwd=\"$(perl -MPOSIX=getcwd -e 'print quotemeta(getcwd)')\"\n \tcat >gitweb_config.perl <<EOF\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n \n # gitweb configuration for tests\n \ndiff --git a/t/t7006/test-terminal.perl b/t/t7006/test-terminal.perl\nindex 73ff809..840bab7 100755\n--- a/t/t7006/test-terminal.perl\n+++ b/t/t7006/test-terminal.perl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n use strict;\n use warnings;\n use IO::Pty;\ndiff --git a/t/t9138-git-svn-authors-prog.sh b/t/t9138-git-svn-authors-prog.sh\nindex 83cc5fc..ac1dcd7 100755\n--- a/t/t9138-git-svn-authors-prog.sh\n+++ b/t/t9138-git-svn-authors-prog.sh\n@@ -8,7 +8,7 @@ test_description='git svn authors prog tests'\n . ./lib-git-svn.sh\n \n cat > svn-authors-prog <<'EOF'\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n $_ = shift;\n if (s/-sub$//)  {\n \tprint \"$_ <$_\\@sub.example.com>\\n\";\ndiff --git a/t/t9700/test.pl b/t/t9700/test.pl\nindex 666722d..abfc9ba 100755\n--- a/t/t9700/test.pl\n+++ b/t/t9700/test.pl\n@@ -1,4 +1,4 @@\n-#!/usr/bin/perl\n+#!/usr/bin/env perl\n use lib (split(/:/, $ENV{GITPERLLIB}));\n \n use 5.006002;\n-- \n1.7.1.98.g4a5f\n"},{"id":"142058","messageId":"AANLkTim6Gcx3wCZoM0D7Vd1z9tnNqwtmPLDf1OjD8LiT@mail.gmail.com","threadId":"23868","inReplyTo":"1274460741-9674-1-git-send-email-avarab@gmail.com","subject":"Re: [PATCH 1/2] perl libs: perl -w + use warnings is redundant","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-05-21T16:55:56Z","receivedAt":"2010-05-21T16:55:56Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, May 21, 2010 at 16:52, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:\n> Turns out that I missed a case or two that could 'use\n> warnings'. I.e. used three-arg open.\n\nThis one should have had a [PATCH v2] subject line. This is really not my day.\n"}]}