{"thread":{"id":"11866","subject":"[PATCH] Make git-remote.perl \"use strict\" compliant","startedAt":"2008-02-04T10:09:00Z","lastAt":"2008-02-04T10:09:00Z","messageCount":1,"participants":["Rafael Garcia-Suarez"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"67340","messageId":"b77c1dce0802040209m11ad0ba7w67d07aee6fc4bccb@mail.gmail.com","threadId":"11866","inReplyTo":null,"subject":"[PATCH] Make git-remote.perl \"use strict\" compliant","fromName":"Rafael Garcia-Suarez","fromEmail":"rgarciasuarez@gmail.com","sentAt":"2008-02-04T10:09:00Z","receivedAt":"2008-02-04T10:09:00Z","isPatch":true,"sender":{"key":"rgarciasuarez@gmail.com","avatar":null},"body":"I was looking at some of the perl commands, and noticed that\ngit-remote was the only one to lack a 'use strict' pragma at the top,\nwhich could be a good thing for its maintainability. Hopefully, the\nrequired changes are minimal.\n\nMake git-remote.perl \"use strict\" compliant\n\nSigned-off-by: Rafael Garcia-Suarez <rgarciasuarez@gmail.com>\n---\n git-remote.perl |   10 ++++++----\n 1 files changed, 6 insertions(+), 4 deletions(-)\n\ndiff --git a/git-remote.perl b/git-remote.perl\nindex d13e4c1..5cd6951 100755\n--- a/git-remote.perl\n+++ b/git-remote.perl\n@@ -1,5 +1,6 @@\n #!/usr/bin/perl -w\n\n+use strict;\n use Git;\n my $git = Git->repository();\n\n@@ -296,12 +297,13 @@ sub add_remote {\n\n sub update_remote {\n \tmy ($name) = @_;\n+\tmy @remotes;\n\n         my $conf = $git->config(\"remotes.\" . $name);\n \tif (defined($conf)) {\n \t\t@remotes = split(' ', $conf);\n \t} elsif ($name eq 'default') {\n-\t\tundef @remotes;\n+\t\t@remotes = ();\n \t\tfor (sort keys %$remote) {\n \t\t\tmy $do_fetch = $git->config_bool(\"remote.\" . $_ .\n \t\t\t\t\t\t    \".skipDefaultUpdate\");\n@@ -341,7 +343,7 @@ sub rm_remote {\n \tmy @refs = $git->command('for-each-ref',\n \t\t'--format=%(refname) %(objectname)', \"refs/remotes/$name\");\n \tfor (@refs) {\n-\t\t($ref, $object) = split;\n+\t\tmy ($ref, $object) = split;\n \t\t$git->command(qw(update-ref -d), $ref, $object);\n \t}\n \treturn 0;\n@@ -352,7 +354,7 @@ sub add_usage {\n \texit(1);\n }\n\n-local $VERBOSE = 0;\n+my $VERBOSE = 0;\n @ARGV = grep {\n \tif ($_ eq '-v' or $_ eq '--verbose') {\n \t\t$VERBOSE=1;\n@@ -395,7 +397,7 @@ elsif ($ARGV[0] eq 'update') {\n \t\tupdate_remote(\"default\");\n \t\texit(1);\n \t}\n-\tfor ($i = 1; $i < @ARGV; $i++) {\n+\tfor (my $i = 1; $i < @ARGV; $i++) {\n \t\tupdate_remote($ARGV[$i]);\n \t}\n }\n"}]}