Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

perl: use "use warnings" instead of -w

Change the Perl scripts to turn on lexical warnings instead of setting
the global $^W variable via the -w switch.

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

As an auxiliary benefit it's now possible to build Git with:

    PERL_PATH='/usr/bin/env perl'

Which would previously result in failures, since "#!/usr/bin/env perl -w"
doesn't work as a shebang.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information...
commit 3328acedc6104e3d46e8f0d26006d9650092ef3e 1 parent d48b284
Ævar Arnfjörð Bjarmason authored September 24, 2010 gitster committed September 27, 2010
2  contrib/examples/git-svnimport.perl
... ...
@@ -1,4 +1,4 @@
1  
-#!/usr/bin/perl -w
  1
+#!/usr/bin/perl
2 2
 
3 3
 # This tool is copyright (c) 2005, Matthias Urlichs.
4 4
 # It is released under the Gnu Public License, version 2.
3  contrib/fast-import/import-directories.perl
... ...
@@ -1,4 +1,4 @@
1  
-#!/usr/bin/perl -w
  1
+#!/usr/bin/perl
2 2
 #
3 3
 # Copyright 2008-2009 Peter Krefting <peter@softwolves.pp.se>
4 4
 #
@@ -140,6 +140,7 @@ =head3 Revision commit message section
140 140
 
141 141
 # Globals
142 142
 use strict;
  143
+use warnings;
143 144
 use integer;
144 145
 my $crlfmode = 0;
145 146
 my @revs;
3  git-add--interactive.perl
... ...
@@ -1,7 +1,8 @@
1  
-#!/usr/bin/perl -w
  1
+#!/usr/bin/perl
2 2
 
3 3
 use 5.008;
4 4
 use strict;
  5
+use warnings;
5 6
 use Git;
6 7
 
7 8
 binmode(STDOUT, ":raw");
2  git-archimport.perl
... ...
@@ -1,4 +1,4 @@
1  
-#!/usr/bin/perl -w
  1
+#!/usr/bin/perl
2 2
 #
3 3
 # This tool is copyright (c) 2005, Martin Langhoff.
4 4
 # It is released under the Gnu Public License, version 2.
3  git-cvsexportcommit.perl
... ...
@@ -1,7 +1,8 @@
1  
-#!/usr/bin/perl -w
  1
+#!/usr/bin/perl
2 2
 
3 3
 use 5.008;
4 4
 use strict;
  5
+use warnings;
5 6
 use Getopt::Std;
6 7
 use File::Temp qw(tempdir);
7 8
 use Data::Dumper;
2  git-cvsimport.perl
... ...
@@ -1,4 +1,4 @@
1  
-#!/usr/bin/perl -w
  1
+#!/usr/bin/perl
2 2
 
3 3
 # This tool is copyright (c) 2005, Matthias Urlichs.
4 4
 # It is released under the Gnu Public License, version 2.
2  git-send-email.perl
... ...
@@ -1,4 +1,4 @@
1  
-#!/usr/bin/perl -w
  1
+#!/usr/bin/perl
2 2
 #
3 3
 # Copyright 2002,2005 Greg Kroah-Hartman <greg@kroah.com>
4 4
 # Copyright 2005 Ryan Anderson <ryan@michonline.com>

0 notes on commit 3328ace

Please sign in to comment.
Something went wrong with that request. Please try again.