Skip to content

Commit 3328ace

Browse files
avargitster
authored andcommitted
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>
1 parent d48b284 commit 3328ace

7 files changed

Lines changed: 10 additions & 7 deletions

File tree

contrib/examples/git-svnimport.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/perl -w
1+
#!/usr/bin/perl
22

33
# This tool is copyright (c) 2005, Matthias Urlichs.
44
# It is released under the Gnu Public License, version 2.

contrib/fast-import/import-directories.perl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/perl -w
1+
#!/usr/bin/perl
22
#
33
# Copyright 2008-2009 Peter Krefting <peter@softwolves.pp.se>
44
#
@@ -140,6 +140,7 @@ =head3 Revision commit message section
140140

141141
# Globals
142142
use strict;
143+
use warnings;
143144
use integer;
144145
my $crlfmode = 0;
145146
my @revs;

git-add--interactive.perl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
#!/usr/bin/perl -w
1+
#!/usr/bin/perl
22

33
use 5.008;
44
use strict;
5+
use warnings;
56
use Git;
67

78
binmode(STDOUT, ":raw");

git-archimport.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/perl -w
1+
#!/usr/bin/perl
22
#
33
# This tool is copyright (c) 2005, Martin Langhoff.
44
# It is released under the Gnu Public License, version 2.

git-cvsexportcommit.perl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
#!/usr/bin/perl -w
1+
#!/usr/bin/perl
22

33
use 5.008;
44
use strict;
5+
use warnings;
56
use Getopt::Std;
67
use File::Temp qw(tempdir);
78
use Data::Dumper;

git-cvsimport.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/perl -w
1+
#!/usr/bin/perl
22

33
# This tool is copyright (c) 2005, Matthias Urlichs.
44
# It is released under the Gnu Public License, version 2.

git-send-email.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/perl -w
1+
#!/usr/bin/perl
22
#
33
# Copyright 2002,2005 Greg Kroah-Hartman <greg@kroah.com>
44
# Copyright 2005 Ryan Anderson <ryan@michonline.com>

0 commit comments

Comments
 (0)