git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] perl libs: perl -w + use warnings is redundant
@ 2010-05-21 14:50 Ævar Arnfjörð Bjarmason
  2010-05-21 15:01 ` [PATCH] perl shebangs: Use /usr/bin/env, not /usr/bin/perl Ævar Arnfjörð Bjarmason
  2010-05-21 16:52 ` [PATCH 1/2] perl libs: perl -w + use warnings is redundant Ævar Arnfjörð Bjarmason
  0 siblings, 2 replies; 10+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2010-05-21 14:50 UTC (permalink / raw
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Change the Perl scripts to turn on lexical warnings, but only in Perl
scripts that definitely require 5.6.0 or later. I.e. those that either
did 'use warnings' in addition to -w already, or used the three-arg
form of open.

-w sets warnings for all code that interpreter runs. "use warnings" is
lexically scoped. The former is probably not what the authors wanted.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 contrib/examples/git-svnimport.perl         |    2 +-
 contrib/fast-import/import-directories.perl |    3 ++-
 git-add--interactive.perl                   |    3 ++-
 git-archimport.perl                         |    2 +-
 git-send-email.perl                         |    2 +-
 5 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/contrib/examples/git-svnimport.perl b/contrib/examples/git-svnimport.perl
index 4576c4a..ead4c04 100755
--- a/contrib/examples/git-svnimport.perl
+++ b/contrib/examples/git-svnimport.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 # This tool is copyright (c) 2005, Matthias Urlichs.
 # It is released under the Gnu Public License, version 2.
diff --git a/contrib/fast-import/import-directories.perl b/contrib/fast-import/import-directories.perl
index 3a5da4a..7f3afa5 100755
--- a/contrib/fast-import/import-directories.perl
+++ b/contrib/fast-import/import-directories.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 #
 # Copyright 2008-2009 Peter Krefting <peter@softwolves.pp.se>
 #
@@ -140,6 +140,7 @@ by whitespace or other characters.
 
 # Globals
 use strict;
+use warnings;
 use integer;
 my $crlfmode = 0;
 my @revs;
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index 21f1330..c2e7ab4 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -1,6 +1,7 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 use strict;
+use warnings;
 use Git;
 
 binmode(STDOUT, ":raw");
diff --git a/git-archimport.perl b/git-archimport.perl
index 98f3ede..6ee3fca 100755
--- a/git-archimport.perl
+++ b/git-archimport.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 #
 # This tool is copyright (c) 2005, Martin Langhoff.
 # It is released under the Gnu Public License, version 2.
diff --git a/git-send-email.perl b/git-send-email.perl
index 111c981..bbb03f7 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 #
 # Copyright 2002,2005 Greg Kroah-Hartman <greg@kroah.com>
 # Copyright 2005 Ryan Anderson <ryan@michonline.com>
-- 
1.7.1.98.g4a5f

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

* [PATCH] perl shebangs: Use /usr/bin/env, not /usr/bin/perl
  2010-05-21 14:50 [PATCH] perl libs: perl -w + use warnings is redundant Ævar Arnfjörð Bjarmason
@ 2010-05-21 15:01 ` Ævar Arnfjörð Bjarmason
  2010-05-21 15:15   ` Peter Kjellerstedt
  2010-05-21 15:32   ` Randal L. Schwartz
  2010-05-21 16:52 ` [PATCH 1/2] perl libs: perl -w + use warnings is redundant Ævar Arnfjörð Bjarmason
  1 sibling, 2 replies; 10+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2010-05-21 15:01 UTC (permalink / raw
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

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

This only affects shebangs in the uninstalled source tree. On
installation shebangs will still be munged to PERL_PATH, which is
currently /usr/bin/perl by default.

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

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---

This should probably have been a series, not an individual patch since
it depends on <1274453455-1941-1-git-send-email-avarab@gmail.com> to
apply. However the two are functionally independent. I can alter this
one so that it applies to the current master on request, but I'm
guessing the "perl libs: perl -w + use warnings is redundant" patch is
wanted anyway.

 Documentation/build-docdep.perl             |    2 +-
 Documentation/cat-texi.perl                 |    2 +-
 Documentation/cmd-list.perl                 |    2 +-
 Documentation/fix-texi.perl                 |    2 +-
 compat/vcbuild/scripts/clink.pl             |    2 +-
 compat/vcbuild/scripts/lib.pl               |    2 +-
 contrib/blameview/blameview.perl            |    2 +-
 contrib/buildsystems/engine.pl              |    2 +-
 contrib/buildsystems/generate               |    2 +-
 contrib/buildsystems/parse.pl               |    2 +-
 contrib/continuous/cidaemon                 |    2 +-
 contrib/continuous/post-receive-cinotify    |    2 +-
 contrib/examples/git-remote.perl            |    2 +-
 contrib/examples/git-rerere.perl            |    2 +-
 contrib/examples/git-svnimport.perl         |    2 +-
 contrib/fast-import/git-import.perl         |    2 +-
 contrib/fast-import/import-directories.perl |    2 +-
 contrib/fast-import/import-tars.perl        |    2 +-
 contrib/hooks/setgitperms.perl              |    2 +-
 contrib/hooks/update-paranoid               |    2 +-
 contrib/stats/mailmap.pl                    |    2 +-
 contrib/stats/packinfo.pl                   |    2 +-
 git-add--interactive.perl                   |    2 +-
 git-archimport.perl                         |    2 +-
 git-cvsexportcommit.perl                    |    2 +-
 git-cvsimport.perl                          |    2 +-
 git-cvsserver.perl                          |    2 +-
 git-send-email.perl                         |    2 +-
 gitweb/gitweb.perl                          |    2 +-
 t/gitweb-lib.sh                             |    2 +-
 t/t7006/test-terminal.perl                  |    2 +-
 t/t9138-git-svn-authors-prog.sh             |    2 +-
 t/t9700/test.pl                             |    2 +-
 33 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/Documentation/build-docdep.perl b/Documentation/build-docdep.perl
index ba4205e..dc50f21 100755
--- a/Documentation/build-docdep.perl
+++ b/Documentation/build-docdep.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 my %include = ();
 my %included = ();
diff --git a/Documentation/cat-texi.perl b/Documentation/cat-texi.perl
index 828ec62..d96d2f1 100755
--- a/Documentation/cat-texi.perl
+++ b/Documentation/cat-texi.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl -w
 
 my @menu = ();
 my $output = $ARGV[0];
diff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl
index 04f9977..dfb9014 100755
--- a/Documentation/cmd-list.perl
+++ b/Documentation/cmd-list.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl -w
 
 use File::Compare qw(compare);
 
diff --git a/Documentation/fix-texi.perl b/Documentation/fix-texi.perl
index ff7d78f..b87b3ba 100755
--- a/Documentation/fix-texi.perl
+++ b/Documentation/fix-texi.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl -w
 
 while (<>) {
 	if (/^\@setfilename/) {
diff --git a/compat/vcbuild/scripts/clink.pl b/compat/vcbuild/scripts/clink.pl
index 4374771..a5f8d07 100644
--- a/compat/vcbuild/scripts/clink.pl
+++ b/compat/vcbuild/scripts/clink.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl -w
 ######################################################################
 # Compiles or links files
 #
diff --git a/compat/vcbuild/scripts/lib.pl b/compat/vcbuild/scripts/lib.pl
index d8054e4..ee84781 100644
--- a/compat/vcbuild/scripts/lib.pl
+++ b/compat/vcbuild/scripts/lib.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl -w
 ######################################################################
 # Libifies files on Windows
 #
diff --git a/contrib/blameview/blameview.perl b/contrib/blameview/blameview.perl
index 1dec001..438b737 100755
--- a/contrib/blameview/blameview.perl
+++ b/contrib/blameview/blameview.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 use Gtk2 -init;
 use Gtk2::SimpleList;
diff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl
index 23da787..286d40f 100644
--- a/contrib/buildsystems/engine.pl
+++ b/contrib/buildsystems/engine.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl -w
 ######################################################################
 # Do not call this script directly!
 #
diff --git a/contrib/buildsystems/generate b/contrib/buildsystems/generate
index bc10f25..926eb77 100644
--- a/contrib/buildsystems/generate
+++ b/contrib/buildsystems/generate
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl -w
 ######################################################################
 # Generate buildsystem files
 #
diff --git a/contrib/buildsystems/parse.pl b/contrib/buildsystems/parse.pl
index c9656ec..4dd9132 100644
--- a/contrib/buildsystems/parse.pl
+++ b/contrib/buildsystems/parse.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl -w
 ######################################################################
 # Do not call this script directly!
 #
diff --git a/contrib/continuous/cidaemon b/contrib/continuous/cidaemon
index 4009a15..9f10ce5 100644
--- a/contrib/continuous/cidaemon
+++ b/contrib/continuous/cidaemon
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 #
 # A daemon that waits for update events sent by its companion
 # post-receive-cinotify hook, checks out a new copy of source,
diff --git a/contrib/continuous/post-receive-cinotify b/contrib/continuous/post-receive-cinotify
index b8f5a60..aeef222 100644
--- a/contrib/continuous/post-receive-cinotify
+++ b/contrib/continuous/post-receive-cinotify
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 #
 # A hook that notifies its companion cidaemon through a simple
 # queue file that a ref has been updated via a push (actually
diff --git a/contrib/examples/git-remote.perl b/contrib/examples/git-remote.perl
index b17952a..09db6f5 100755
--- a/contrib/examples/git-remote.perl
+++ b/contrib/examples/git-remote.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl -w
 
 use strict;
 use Git;
diff --git a/contrib/examples/git-rerere.perl b/contrib/examples/git-rerere.perl
index 4f69209..110c27f 100755
--- a/contrib/examples/git-rerere.perl
+++ b/contrib/examples/git-rerere.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 #
 # REuse REcorded REsolve.  This tool records a conflicted automerge
 # result and its hand resolution, and helps to resolve future
diff --git a/contrib/examples/git-svnimport.perl b/contrib/examples/git-svnimport.perl
index ead4c04..c4ded33 100755
--- a/contrib/examples/git-svnimport.perl
+++ b/contrib/examples/git-svnimport.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 # This tool is copyright (c) 2005, Matthias Urlichs.
 # It is released under the Gnu Public License, version 2.
diff --git a/contrib/fast-import/git-import.perl b/contrib/fast-import/git-import.perl
index f9fef6d..275c3b9 100755
--- a/contrib/fast-import/git-import.perl
+++ b/contrib/fast-import/git-import.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 #
 # Performs an initial import of a directory. This is the equivalent
 # of doing 'git init; git add .; git commit'. It's a little slower,
diff --git a/contrib/fast-import/import-directories.perl b/contrib/fast-import/import-directories.perl
index 7f3afa5..a02daa8 100755
--- a/contrib/fast-import/import-directories.perl
+++ b/contrib/fast-import/import-directories.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 #
 # Copyright 2008-2009 Peter Krefting <peter@softwolves.pp.se>
 #
diff --git a/contrib/fast-import/import-tars.perl b/contrib/fast-import/import-tars.perl
index 95438e1..1b667e3 100755
--- a/contrib/fast-import/import-tars.perl
+++ b/contrib/fast-import/import-tars.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 ## tar archive frontend for git-fast-import
 ##
diff --git a/contrib/hooks/setgitperms.perl b/contrib/hooks/setgitperms.perl
index a577ad0..b33f094 100644
--- a/contrib/hooks/setgitperms.perl
+++ b/contrib/hooks/setgitperms.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 #
 # Copyright (c) 2006 Josh England
 #
diff --git a/contrib/hooks/update-paranoid b/contrib/hooks/update-paranoid
index d18b317..95595ac 100644
--- a/contrib/hooks/update-paranoid
+++ b/contrib/hooks/update-paranoid
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 use strict;
 use File::Spec;
diff --git a/contrib/stats/mailmap.pl b/contrib/stats/mailmap.pl
index 4b852e2..af92759 100755
--- a/contrib/stats/mailmap.pl
+++ b/contrib/stats/mailmap.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl -w
 my %mailmap = ();
 open I, "<", ".mailmap";
 while (<I>) {
diff --git a/contrib/stats/packinfo.pl b/contrib/stats/packinfo.pl
index be188c0..51823ac 100755
--- a/contrib/stats/packinfo.pl
+++ b/contrib/stats/packinfo.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 #
 # This tool will print vaguely pretty information about a pack.  It
 # expects the output of "git verify-pack -v" as input on stdin.
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index c2e7ab4..0826aab 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 use strict;
 use warnings;
diff --git a/git-archimport.perl b/git-archimport.perl
index 6ee3fca..a5e79fd 100755
--- a/git-archimport.perl
+++ b/git-archimport.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 #
 # This tool is copyright (c) 2005, Martin Langhoff.
 # It is released under the Gnu Public License, version 2.
diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index 59b6722..fac4c6f 100755
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl -w
 
 use strict;
 use Getopt::Std;
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 9e03eee..5470c81 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl -w
 
 # This tool is copyright (c) 2005, Matthias Urlichs.
 # It is released under the Gnu Public License, version 2.
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 13751db..dc1c5dd 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 ####
 #### This application is a CVS emulation layer for git.
diff --git a/git-send-email.perl b/git-send-email.perl
index bbb03f7..27bdca5 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 #
 # Copyright 2002,2005 Greg Kroah-Hartman <greg@kroah.com>
 # Copyright 2005 Ryan Anderson <ryan@michonline.com>
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 77e5f79..dbb0cc0 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 # gitweb - simple web interface to track changes in git repositories
 #
diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh
index 5a734b1..9572c6a 100644
--- a/t/gitweb-lib.sh
+++ b/t/gitweb-lib.sh
@@ -6,7 +6,7 @@
 gitweb_init () {
 	safe_pwd="$(perl -MPOSIX=getcwd -e 'print quotemeta(getcwd)')"
 	cat >gitweb_config.perl <<EOF
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 # gitweb configuration for tests
 
diff --git a/t/t7006/test-terminal.perl b/t/t7006/test-terminal.perl
index 73ff809..840bab7 100755
--- a/t/t7006/test-terminal.perl
+++ b/t/t7006/test-terminal.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 use strict;
 use warnings;
 use IO::Pty;
diff --git a/t/t9138-git-svn-authors-prog.sh b/t/t9138-git-svn-authors-prog.sh
index 83cc5fc..ac1dcd7 100755
--- a/t/t9138-git-svn-authors-prog.sh
+++ b/t/t9138-git-svn-authors-prog.sh
@@ -8,7 +8,7 @@ test_description='git svn authors prog tests'
 . ./lib-git-svn.sh
 
 cat > svn-authors-prog <<'EOF'
-#!/usr/bin/perl
+#!/usr/bin/env perl
 $_ = shift;
 if (s/-sub$//)  {
 	print "$_ <$_\@sub.example.com>\n";
diff --git a/t/t9700/test.pl b/t/t9700/test.pl
index 666722d..abfc9ba 100755
--- a/t/t9700/test.pl
+++ b/t/t9700/test.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 use lib (split(/:/, $ENV{GITPERLLIB}));
 
 use 5.006002;
-- 
1.7.1.98.g4a5f

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

* RE: [PATCH] perl shebangs: Use /usr/bin/env, not /usr/bin/perl
  2010-05-21 15:01 ` [PATCH] perl shebangs: Use /usr/bin/env, not /usr/bin/perl Ævar Arnfjörð Bjarmason
@ 2010-05-21 15:15   ` Peter Kjellerstedt
  2010-05-21 15:22     ` Ævar Arnfjörð Bjarmason
  2010-05-21 15:26     ` [PATCH] " Tor Arntsen
  2010-05-21 15:32   ` Randal L. Schwartz
  1 sibling, 2 replies; 10+ messages in thread
From: Peter Kjellerstedt @ 2010-05-21 15:15 UTC (permalink / raw
  To: Ævar Arnfjörð Bjarmason, git@vger.kernel.org
  Cc: Junio C Hamano

> -----Original Message-----
> From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On
> Behalf Of Ævar Arnfjörð Bjarmason
> Sent: den 21 maj 2010 17:01
> To: git@vger.kernel.org
> Cc: Junio C Hamano; Ævar Arnfjörð Bjarmason
> Subject: [PATCH] perl shebangs: Use /usr/bin/env, not /usr/bin/perl
> 
> Change the Perl Git utilities to use #!/usr/bin/env perl as a shebang
> instead of #!/usr/bin/perl. This makes e.g. git-send-email work if
> your personal perl has Net::SMTP::SSL, but your system perl doesn't.
> 
> This only affects shebangs in the uninstalled source tree. On
> installation shebangs will still be munged to PERL_PATH, which is
> currently /usr/bin/perl by default.
> 
> With this change all the code in Git that uses a shebang now uses
> /usr/bin/env, except those things that use /bin/sh and /bin/bash. All
> the Python code already used it, and some of the Perl code.
> 
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
> 
> This should probably have been a series, not an individual patch since
> it depends on <1274453455-1941-1-git-send-email-avarab@gmail.com> to
> apply. However the two are functionally independent. I can alter this
> one so that it applies to the current master on request, but I'm
> guessing the "perl libs: perl -w + use warnings is redundant" patch is
> wanted anyway.
> 
>  Documentation/build-docdep.perl             |    2 +-
>  Documentation/cat-texi.perl                 |    2 +-
>  Documentation/cmd-list.perl                 |    2 +-
>  Documentation/fix-texi.perl                 |    2 +-
>  compat/vcbuild/scripts/clink.pl             |    2 +-
>  compat/vcbuild/scripts/lib.pl               |    2 +-
>  contrib/blameview/blameview.perl            |    2 +-
>  contrib/buildsystems/engine.pl              |    2 +-
>  contrib/buildsystems/generate               |    2 +-
>  contrib/buildsystems/parse.pl               |    2 +-
>  contrib/continuous/cidaemon                 |    2 +-
>  contrib/continuous/post-receive-cinotify    |    2 +-
>  contrib/examples/git-remote.perl            |    2 +-
>  contrib/examples/git-rerere.perl            |    2 +-
>  contrib/examples/git-svnimport.perl         |    2 +-
>  contrib/fast-import/git-import.perl         |    2 +-
>  contrib/fast-import/import-directories.perl |    2 +-
>  contrib/fast-import/import-tars.perl        |    2 +-
>  contrib/hooks/setgitperms.perl              |    2 +-
>  contrib/hooks/update-paranoid               |    2 +-
>  contrib/stats/mailmap.pl                    |    2 +-
>  contrib/stats/packinfo.pl                   |    2 +-
>  git-add--interactive.perl                   |    2 +-
>  git-archimport.perl                         |    2 +-
>  git-cvsexportcommit.perl                    |    2 +-
>  git-cvsimport.perl                          |    2 +-
>  git-cvsserver.perl                          |    2 +-
>  git-send-email.perl                         |    2 +-
>  gitweb/gitweb.perl                          |    2 +-
>  t/gitweb-lib.sh                             |    2 +-
>  t/t7006/test-terminal.perl                  |    2 +-
>  t/t9138-git-svn-authors-prog.sh             |    2 +-
>  t/t9700/test.pl                             |    2 +-
>  33 files changed, 33 insertions(+), 33 deletions(-)
> 
> diff --git a/Documentation/build-docdep.perl b/Documentation/build-
> docdep.perl
> index ba4205e..dc50f21 100755
> --- a/Documentation/build-docdep.perl
> +++ b/Documentation/build-docdep.perl
> @@ -1,4 +1,4 @@
> -#!/usr/bin/perl
> +#!/usr/bin/env perl
> 
>  my %include = ();
>  my %included = ();
> diff --git a/Documentation/cat-texi.perl b/Documentation/cat-texi.perl
> index 828ec62..d96d2f1 100755
> --- a/Documentation/cat-texi.perl
> +++ b/Documentation/cat-texi.perl
> @@ -1,4 +1,4 @@
> -#!/usr/bin/perl -w
> +#!/usr/bin/env perl -w

This does not work. You cannot give arguments to an application 
started via /usr/bin/env; it will interprete everything after 
/usr/bin/env as the application name and fail with:

/usr/bin/env: perl -w: No such file or directory

//Peter


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

* Re: [PATCH] perl shebangs: Use /usr/bin/env, not /usr/bin/perl
  2010-05-21 15:15   ` Peter Kjellerstedt
@ 2010-05-21 15:22     ` Ævar Arnfjörð Bjarmason
  2010-05-21 16:54       ` [PATCH v2] " Ævar Arnfjörð Bjarmason
  2010-05-21 15:26     ` [PATCH] " Tor Arntsen
  1 sibling, 1 reply; 10+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2010-05-21 15:22 UTC (permalink / raw
  To: Peter Kjellerstedt; +Cc: git@vger.kernel.org, Junio C Hamano

On Fri, May 21, 2010 at 15:15, Peter Kjellerstedt
<peter.kjellerstedt@axis.com> wrote:
> This does not work. You cannot give arguments to an application
> started via /usr/bin/env; it will interprete everything after
> /usr/bin/env as the application name and fail with:

Doh'oh. You're right of course. I just tested it on the command-line
and by executing the scripts (Perl interprets the shebang itself):

    $ /usr/bin/env perl -w -le 'print $^W'
    1

However. Isn't Perl 5.6 the lowest version Git aspires to be
compatible with anyway? If that's the case they can just be changed to
'use warnings' across the board.

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

* Re: [PATCH] perl shebangs: Use /usr/bin/env, not /usr/bin/perl
  2010-05-21 15:15   ` Peter Kjellerstedt
  2010-05-21 15:22     ` Ævar Arnfjörð Bjarmason
@ 2010-05-21 15:26     ` Tor Arntsen
  1 sibling, 0 replies; 10+ messages in thread
From: Tor Arntsen @ 2010-05-21 15:26 UTC (permalink / raw
  To: Peter Kjellerstedt
  Cc: Ævar Arnfjörð Bjarmason, git@vger.kernel.org,
	Junio C Hamano

On Fri, May 21, 2010 at 17:15, Peter Kjellerstedt
<peter.kjellerstedt@axis.com> wrote:
> This does not work. You cannot give arguments to an application
> started via /usr/bin/env; it will interprete everything after
> /usr/bin/env as the application name and fail with:
>
> /usr/bin/env: perl -w: No such file or directory

Yep. It would have to be changed to
/usr/bin/env perl
and add
BEGIN {$^W = 1;}
to the script.

That been said, I've used /usr/bin/env perl for customer applications
for years and years, without problems.  Things wouldn't have worked
otherwise, because on e.g. IRIX systems the /usr/bin/perl version
would be 5.005 and the /usr/freeware version would be 5.6.1.BUt the
caveat is that you'll need to change -w to the above.

-Tor

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

* Re: [PATCH] perl shebangs: Use /usr/bin/env, not /usr/bin/perl
  2010-05-21 15:01 ` [PATCH] perl shebangs: Use /usr/bin/env, not /usr/bin/perl Ævar Arnfjörð Bjarmason
  2010-05-21 15:15   ` Peter Kjellerstedt
@ 2010-05-21 15:32   ` Randal L. Schwartz
  2010-05-21 16:01     ` Jeff King
  1 sibling, 1 reply; 10+ messages in thread
From: Randal L. Schwartz @ 2010-05-21 15:32 UTC (permalink / raw
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

>>>>> "Æ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

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

* Re: [PATCH] perl shebangs: Use /usr/bin/env, not /usr/bin/perl
  2010-05-21 15:32   ` Randal L. Schwartz
@ 2010-05-21 16:01     ` Jeff King
  0 siblings, 0 replies; 10+ messages in thread
From: Jeff King @ 2010-05-21 16:01 UTC (permalink / raw
  To: Randal L. Schwartz
  Cc: Ævar Arnfjörð Bjarmason, git, Junio C Hamano

On Fri, May 21, 2010 at 08:32:53AM -0700, Randal L. Schwartz wrote:

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

Don't we already provide a knob? The Makefile has:

  $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl
  [...]
          sed -e '1{' \
              -e '        s|#!.*perl|#!$(PERL_PATH_SQ)|' \
  [...]

So just setting PERL_PATH should be enough (from which PERL_PATH_SQ is
derived).

-Peff

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

* [PATCH 1/2] perl libs: perl -w + use warnings is redundant
  2010-05-21 14:50 [PATCH] perl libs: perl -w + use warnings is redundant Ævar Arnfjörð Bjarmason
  2010-05-21 15:01 ` [PATCH] perl shebangs: Use /usr/bin/env, not /usr/bin/perl Ævar Arnfjörð Bjarmason
@ 2010-05-21 16:52 ` Ævar Arnfjörð Bjarmason
  2010-05-21 16:55   ` Ævar Arnfjörð Bjarmason
  1 sibling, 1 reply; 10+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2010-05-21 16:52 UTC (permalink / raw
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Change the Perl scripts to turn on lexical warnings, but only in Perl
scripts that definitely require 5.6.0 or later. I.e. those that either
did 'use warnings' in addition to -w already, or used the three-arg
form of open.

-w sets warnings for all code that interpreter runs. "use warnings" is
lexically scoped. The former is probably not what the authors wanted.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---

Turns out that I missed a case or two that could 'use
warnings'. I.e. used three-arg open.

 Documentation/cat-texi.perl                 |    3 ++-
 Documentation/cmd-list.perl                 |    4 ++--
 contrib/examples/git-remote.perl            |    3 ++-
 contrib/examples/git-svnimport.perl         |    2 +-
 contrib/fast-import/import-directories.perl |    3 ++-
 contrib/stats/mailmap.pl                    |    3 ++-
 git-add--interactive.perl                   |    3 ++-
 git-archimport.perl                         |    2 +-
 git-cvsimport.perl                          |    2 +-
 git-send-email.perl                         |    2 +-
 10 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/Documentation/cat-texi.perl b/Documentation/cat-texi.perl
index 828ec62..082978f 100755
--- a/Documentation/cat-texi.perl
+++ b/Documentation/cat-texi.perl
@@ -1,4 +1,5 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
+use warnings;
 
 my @menu = ();
 my $output = $ARGV[0];
diff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl
index 04f9977..07d526e 100755
--- a/Documentation/cmd-list.perl
+++ b/Documentation/cmd-list.perl
@@ -1,5 +1,5 @@
-#!/usr/bin/perl -w
-
+#!/usr/bin/perl
+use warnings;
 use File::Compare qw(compare);
 
 sub format_one {
diff --git a/contrib/examples/git-remote.perl b/contrib/examples/git-remote.perl
index b17952a..48ab0ef 100755
--- a/contrib/examples/git-remote.perl
+++ b/contrib/examples/git-remote.perl
@@ -1,6 +1,7 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 use strict;
+use warnings;
 use Git;
 my $git = Git->repository();
 
diff --git a/contrib/examples/git-svnimport.perl b/contrib/examples/git-svnimport.perl
index 4576c4a..ead4c04 100755
--- a/contrib/examples/git-svnimport.perl
+++ b/contrib/examples/git-svnimport.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 # This tool is copyright (c) 2005, Matthias Urlichs.
 # It is released under the Gnu Public License, version 2.
diff --git a/contrib/fast-import/import-directories.perl b/contrib/fast-import/import-directories.perl
index 3a5da4a..7f3afa5 100755
--- a/contrib/fast-import/import-directories.perl
+++ b/contrib/fast-import/import-directories.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 #
 # Copyright 2008-2009 Peter Krefting <peter@softwolves.pp.se>
 #
@@ -140,6 +140,7 @@ by whitespace or other characters.
 
 # Globals
 use strict;
+use warnings;
 use integer;
 my $crlfmode = 0;
 my @revs;
diff --git a/contrib/stats/mailmap.pl b/contrib/stats/mailmap.pl
index 4b852e2..ff296fa 100755
--- a/contrib/stats/mailmap.pl
+++ b/contrib/stats/mailmap.pl
@@ -1,4 +1,5 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
+use warnings;
 my %mailmap = ();
 open I, "<", ".mailmap";
 while (<I>) {
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index 21f1330..c2e7ab4 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -1,6 +1,7 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 use strict;
+use warnings;
 use Git;
 
 binmode(STDOUT, ":raw");
diff --git a/git-archimport.perl b/git-archimport.perl
index 98f3ede..6ee3fca 100755
--- a/git-archimport.perl
+++ b/git-archimport.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 #
 # This tool is copyright (c) 2005, Martin Langhoff.
 # It is released under the Gnu Public License, version 2.
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 9e03eee..d5e5677 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 # This tool is copyright (c) 2005, Matthias Urlichs.
 # It is released under the Gnu Public License, version 2.
diff --git a/git-send-email.perl b/git-send-email.perl
index 111c981..bbb03f7 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 #
 # Copyright 2002,2005 Greg Kroah-Hartman <greg@kroah.com>
 # Copyright 2005 Ryan Anderson <ryan@michonline.com>
-- 
1.7.1.98.g4a5f

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

* [PATCH v2] perl shebangs: Use /usr/bin/env, not /usr/bin/perl
  2010-05-21 15:22     ` Ævar Arnfjörð Bjarmason
@ 2010-05-21 16:54       ` Ævar Arnfjörð Bjarmason
  0 siblings, 0 replies; 10+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2010-05-21 16:54 UTC (permalink / raw
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Change the Perl Git utilities to use #!/usr/bin/env perl as a shebang
instead of #!/usr/bin/perl. In cases where perl -w was part of the
shebang I've replaced it with BEGIN { $^W = 0 }. use warnings would be
better, but this doesn't break systems still running perl 5.005.

This only affects shebangs in the uninstalled source tree. On
installation shebangs will still be munged to PERL_PATH, which is
currently /usr/bin/perl by default.

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

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---

Replaces /usr/bin/env perl -w with just perl + BEGIN { $^W = 1 } which
has the same effect as -w. I.e. turns on warnings globally.

 Documentation/build-docdep.perl             |    2 +-
 Documentation/cat-texi.perl                 |    2 +-
 Documentation/cmd-list.perl                 |    4 ++--
 Documentation/fix-texi.perl                 |    3 ++-
 compat/vcbuild/scripts/clink.pl             |    3 ++-
 compat/vcbuild/scripts/lib.pl               |    3 ++-
 contrib/blameview/blameview.perl            |    2 +-
 contrib/buildsystems/engine.pl              |    3 ++-
 contrib/buildsystems/generate               |    3 ++-
 contrib/buildsystems/parse.pl               |    3 ++-
 contrib/continuous/cidaemon                 |    2 +-
 contrib/continuous/post-receive-cinotify    |    2 +-
 contrib/examples/git-remote.perl            |    2 +-
 contrib/examples/git-rerere.perl            |    2 +-
 contrib/examples/git-svnimport.perl         |    2 +-
 contrib/fast-import/git-import.perl         |    2 +-
 contrib/fast-import/import-directories.perl |    2 +-
 contrib/fast-import/import-tars.perl        |    2 +-
 contrib/hooks/setgitperms.perl              |    2 +-
 contrib/hooks/update-paranoid               |    2 +-
 contrib/stats/mailmap.pl                    |    3 +--
 contrib/stats/packinfo.pl                   |    2 +-
 git-add--interactive.perl                   |    2 +-
 git-archimport.perl                         |    2 +-
 git-cvsexportcommit.perl                    |    4 ++--
 git-cvsimport.perl                          |    2 +-
 git-cvsserver.perl                          |    2 +-
 git-send-email.perl                         |    2 +-
 gitweb/gitweb.perl                          |    2 +-
 t/gitweb-lib.sh                             |    2 +-
 t/t7006/test-terminal.perl                  |    2 +-
 t/t9138-git-svn-authors-prog.sh             |    2 +-
 t/t9700/test.pl                             |    2 +-
 33 files changed, 41 insertions(+), 36 deletions(-)

diff --git a/Documentation/build-docdep.perl b/Documentation/build-docdep.perl
index ba4205e..dc50f21 100755
--- a/Documentation/build-docdep.perl
+++ b/Documentation/build-docdep.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 my %include = ();
 my %included = ();
diff --git a/Documentation/cat-texi.perl b/Documentation/cat-texi.perl
index 082978f..3b4fb2d 100755
--- a/Documentation/cat-texi.perl
+++ b/Documentation/cat-texi.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 use warnings;
 
 my @menu = ();
diff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl
index 07d526e..dfb9014 100755
--- a/Documentation/cmd-list.perl
+++ b/Documentation/cmd-list.perl
@@ -1,5 +1,5 @@
-#!/usr/bin/perl
-use warnings;
+#!/usr/bin/env perl -w
+
 use File::Compare qw(compare);
 
 sub format_one {
diff --git a/Documentation/fix-texi.perl b/Documentation/fix-texi.perl
index ff7d78f..bd5b6dd 100755
--- a/Documentation/fix-texi.perl
+++ b/Documentation/fix-texi.perl
@@ -1,4 +1,5 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+BEGIN { $^W = 1 }
 
 while (<>) {
 	if (/^\@setfilename/) {
diff --git a/compat/vcbuild/scripts/clink.pl b/compat/vcbuild/scripts/clink.pl
index 4374771..748e659 100644
--- a/compat/vcbuild/scripts/clink.pl
+++ b/compat/vcbuild/scripts/clink.pl
@@ -1,4 +1,5 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+BEGIN { $^W = 1 }
 ######################################################################
 # Compiles or links files
 #
diff --git a/compat/vcbuild/scripts/lib.pl b/compat/vcbuild/scripts/lib.pl
index d8054e4..86b8977 100644
--- a/compat/vcbuild/scripts/lib.pl
+++ b/compat/vcbuild/scripts/lib.pl
@@ -1,4 +1,5 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+BEGIN { $^W = 1 }
 ######################################################################
 # Libifies files on Windows
 #
diff --git a/contrib/blameview/blameview.perl b/contrib/blameview/blameview.perl
index 1dec001..438b737 100755
--- a/contrib/blameview/blameview.perl
+++ b/contrib/blameview/blameview.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 use Gtk2 -init;
 use Gtk2::SimpleList;
diff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl
index 23da787..ad4b82c 100644
--- a/contrib/buildsystems/engine.pl
+++ b/contrib/buildsystems/engine.pl
@@ -1,4 +1,5 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+BEGIN { $^W = 1 }
 ######################################################################
 # Do not call this script directly!
 #
diff --git a/contrib/buildsystems/generate b/contrib/buildsystems/generate
index bc10f25..e3a352f 100644
--- a/contrib/buildsystems/generate
+++ b/contrib/buildsystems/generate
@@ -1,4 +1,5 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+BEGIN { $^W = 1 }
 ######################################################################
 # Generate buildsystem files
 #
diff --git a/contrib/buildsystems/parse.pl b/contrib/buildsystems/parse.pl
index c9656ec..4f932a9 100644
--- a/contrib/buildsystems/parse.pl
+++ b/contrib/buildsystems/parse.pl
@@ -1,4 +1,5 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
+BEGIN { $^W = 1 }
 ######################################################################
 # Do not call this script directly!
 #
diff --git a/contrib/continuous/cidaemon b/contrib/continuous/cidaemon
index 4009a15..9f10ce5 100644
--- a/contrib/continuous/cidaemon
+++ b/contrib/continuous/cidaemon
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 #
 # A daemon that waits for update events sent by its companion
 # post-receive-cinotify hook, checks out a new copy of source,
diff --git a/contrib/continuous/post-receive-cinotify b/contrib/continuous/post-receive-cinotify
index b8f5a60..aeef222 100644
--- a/contrib/continuous/post-receive-cinotify
+++ b/contrib/continuous/post-receive-cinotify
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 #
 # A hook that notifies its companion cidaemon through a simple
 # queue file that a ref has been updated via a push (actually
diff --git a/contrib/examples/git-remote.perl b/contrib/examples/git-remote.perl
index 48ab0ef..ee050a6 100755
--- a/contrib/examples/git-remote.perl
+++ b/contrib/examples/git-remote.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl -w
 
 use strict;
 use warnings;
diff --git a/contrib/examples/git-rerere.perl b/contrib/examples/git-rerere.perl
index 4f69209..110c27f 100755
--- a/contrib/examples/git-rerere.perl
+++ b/contrib/examples/git-rerere.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 #
 # REuse REcorded REsolve.  This tool records a conflicted automerge
 # result and its hand resolution, and helps to resolve future
diff --git a/contrib/examples/git-svnimport.perl b/contrib/examples/git-svnimport.perl
index ead4c04..c4ded33 100755
--- a/contrib/examples/git-svnimport.perl
+++ b/contrib/examples/git-svnimport.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 # This tool is copyright (c) 2005, Matthias Urlichs.
 # It is released under the Gnu Public License, version 2.
diff --git a/contrib/fast-import/git-import.perl b/contrib/fast-import/git-import.perl
index f9fef6d..275c3b9 100755
--- a/contrib/fast-import/git-import.perl
+++ b/contrib/fast-import/git-import.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 #
 # Performs an initial import of a directory. This is the equivalent
 # of doing 'git init; git add .; git commit'. It's a little slower,
diff --git a/contrib/fast-import/import-directories.perl b/contrib/fast-import/import-directories.perl
index 7f3afa5..a02daa8 100755
--- a/contrib/fast-import/import-directories.perl
+++ b/contrib/fast-import/import-directories.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 #
 # Copyright 2008-2009 Peter Krefting <peter@softwolves.pp.se>
 #
diff --git a/contrib/fast-import/import-tars.perl b/contrib/fast-import/import-tars.perl
index 95438e1..1b667e3 100755
--- a/contrib/fast-import/import-tars.perl
+++ b/contrib/fast-import/import-tars.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 ## tar archive frontend for git-fast-import
 ##
diff --git a/contrib/hooks/setgitperms.perl b/contrib/hooks/setgitperms.perl
index a577ad0..b33f094 100644
--- a/contrib/hooks/setgitperms.perl
+++ b/contrib/hooks/setgitperms.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 #
 # Copyright (c) 2006 Josh England
 #
diff --git a/contrib/hooks/update-paranoid b/contrib/hooks/update-paranoid
index d18b317..95595ac 100644
--- a/contrib/hooks/update-paranoid
+++ b/contrib/hooks/update-paranoid
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 use strict;
 use File::Spec;
diff --git a/contrib/stats/mailmap.pl b/contrib/stats/mailmap.pl
index ff296fa..af92759 100755
--- a/contrib/stats/mailmap.pl
+++ b/contrib/stats/mailmap.pl
@@ -1,5 +1,4 @@
-#!/usr/bin/perl
-use warnings;
+#!/usr/bin/env perl -w
 my %mailmap = ();
 open I, "<", ".mailmap";
 while (<I>) {
diff --git a/contrib/stats/packinfo.pl b/contrib/stats/packinfo.pl
index be188c0..51823ac 100755
--- a/contrib/stats/packinfo.pl
+++ b/contrib/stats/packinfo.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 #
 # This tool will print vaguely pretty information about a pack.  It
 # expects the output of "git verify-pack -v" as input on stdin.
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index c2e7ab4..0826aab 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 use strict;
 use warnings;
diff --git a/git-archimport.perl b/git-archimport.perl
index 6ee3fca..a5e79fd 100755
--- a/git-archimport.perl
+++ b/git-archimport.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 #
 # This tool is copyright (c) 2005, Martin Langhoff.
 # It is released under the Gnu Public License, version 2.
diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index 59b6722..a707f5c 100755
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
@@ -1,5 +1,5 @@
-#!/usr/bin/perl -w
-
+#!/usr/bin/env perl
+BEGIN { $^W = 1 }
 use strict;
 use Getopt::Std;
 use File::Temp qw(tempdir);
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index d5e5677..5470c81 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl -w
 
 # This tool is copyright (c) 2005, Matthias Urlichs.
 # It is released under the Gnu Public License, version 2.
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 13751db..dc1c5dd 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 ####
 #### This application is a CVS emulation layer for git.
diff --git a/git-send-email.perl b/git-send-email.perl
index bbb03f7..27bdca5 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 #
 # Copyright 2002,2005 Greg Kroah-Hartman <greg@kroah.com>
 # Copyright 2005 Ryan Anderson <ryan@michonline.com>
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 77e5f79..dbb0cc0 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 # gitweb - simple web interface to track changes in git repositories
 #
diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh
index 5a734b1..9572c6a 100644
--- a/t/gitweb-lib.sh
+++ b/t/gitweb-lib.sh
@@ -6,7 +6,7 @@
 gitweb_init () {
 	safe_pwd="$(perl -MPOSIX=getcwd -e 'print quotemeta(getcwd)')"
 	cat >gitweb_config.perl <<EOF
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 # gitweb configuration for tests
 
diff --git a/t/t7006/test-terminal.perl b/t/t7006/test-terminal.perl
index 73ff809..840bab7 100755
--- a/t/t7006/test-terminal.perl
+++ b/t/t7006/test-terminal.perl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 use strict;
 use warnings;
 use IO::Pty;
diff --git a/t/t9138-git-svn-authors-prog.sh b/t/t9138-git-svn-authors-prog.sh
index 83cc5fc..ac1dcd7 100755
--- a/t/t9138-git-svn-authors-prog.sh
+++ b/t/t9138-git-svn-authors-prog.sh
@@ -8,7 +8,7 @@ test_description='git svn authors prog tests'
 . ./lib-git-svn.sh
 
 cat > svn-authors-prog <<'EOF'
-#!/usr/bin/perl
+#!/usr/bin/env perl
 $_ = shift;
 if (s/-sub$//)  {
 	print "$_ <$_\@sub.example.com>\n";
diff --git a/t/t9700/test.pl b/t/t9700/test.pl
index 666722d..abfc9ba 100755
--- a/t/t9700/test.pl
+++ b/t/t9700/test.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 use lib (split(/:/, $ENV{GITPERLLIB}));
 
 use 5.006002;
-- 
1.7.1.98.g4a5f

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

* Re: [PATCH 1/2] perl libs: perl -w + use warnings is redundant
  2010-05-21 16:52 ` [PATCH 1/2] perl libs: perl -w + use warnings is redundant Ævar Arnfjörð Bjarmason
@ 2010-05-21 16:55   ` Ævar Arnfjörð Bjarmason
  0 siblings, 0 replies; 10+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2010-05-21 16:55 UTC (permalink / raw
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

On Fri, May 21, 2010 at 16:52, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
> Turns out that I missed a case or two that could 'use
> warnings'. I.e. used three-arg open.

This one should have had a [PATCH v2] subject line. This is really not my day.

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

end of thread, other threads:[~2010-05-21 17:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-21 14:50 [PATCH] perl libs: perl -w + use warnings is redundant Ævar Arnfjörð Bjarmason
2010-05-21 15:01 ` [PATCH] perl shebangs: Use /usr/bin/env, not /usr/bin/perl Ævar Arnfjörð Bjarmason
2010-05-21 15:15   ` Peter Kjellerstedt
2010-05-21 15:22     ` Ævar Arnfjörð Bjarmason
2010-05-21 16:54       ` [PATCH v2] " Ævar Arnfjörð Bjarmason
2010-05-21 15:26     ` [PATCH] " Tor Arntsen
2010-05-21 15:32   ` Randal L. Schwartz
2010-05-21 16:01     ` Jeff King
2010-05-21 16:52 ` [PATCH 1/2] perl libs: perl -w + use warnings is redundant Ævar Arnfjörð Bjarmason
2010-05-21 16:55   ` Ævar Arnfjörð Bjarmason

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).