Merge branch 'ab/require-perl-5.8' into maint
authorJunio C Hamano <gitster@pobox.com>
Thu, 9 Dec 2010 18:35:21 +0000 (10:35 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 9 Dec 2010 18:35:21 +0000 (10:35 -0800)
* ab/require-perl-5.8:
perl: use "use warnings" instead of -w
perl: bump the required Perl version to 5.8 from 5.6.[21]

1  2 
git-relink.perl
git-send-email.perl
git-svn.perl
diff --combined git-relink.perl
index c2a0ef8d5a2794a45908cbcfff1b419ebfc17f8e,af2e305fa39aa1b04ffaca7f026eb2a3dda71b0d..e136732cea80c1594ac02c93cf246e8c77ff89b8
@@@ -6,7 -6,7 +6,7 @@@
  #
  # Scan two git object-trees, and hardlink any common objects between them.
  
- use 5.006;
+ use 5.008;
  use strict;
  use warnings;
  use Getopt::Long;
@@@ -163,7 -163,7 +163,7 @@@ sub link_two_files($$) 
  
  
  sub usage() {
 -      print("Usage: git relink [--safe] <dir> [<dir> ...] <master_dir> \n");
 +      print("Usage: git relink [--safe] <dir>... <master_dir> \n");
        print("All directories should contain a .git/objects/ subdirectory.\n");
        print("Options\n");
        print("\t--safe\t" .
diff --combined git-send-email.perl
index 81b2ea5633a9692f52af67ab8bfd42b68781cf4d,d10d869912c187868018e5a7b9d97bad51073b64..c1d8edbdd324fc1eca7bc475cbf31bd913036682
@@@ -1,4 -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>
@@@ -16,6 -16,7 +16,7 @@@
  #    and second line is the subject of the message.
  #
  
+ use 5.008;
  use strict;
  use warnings;
  use Term::ReadLine;
@@@ -85,7 -86,6 +86,7 @@@ git send-email [options] <file | direct
      --[no-]validate                * Perform patch sanity checks. Default on.
      --[no-]format-patch            * understand any non optional arguments as
                                       `git format-patch` ones.
 +    --force                        * Send even if safety checks would prevent it.
  
  EOT
        exit(1);
@@@ -163,7 -163,6 +164,7 @@@ if ($@) 
  my ($quiet, $dry_run) = (0, 0);
  my $format_patch;
  my $compose_filename;
 +my $force = 0;
  
  # Handle interactive edition of files.
  my $multiedit;
@@@ -303,7 -302,6 +304,7 @@@ my $rc = GetOptions("sender|from=s" => 
                    "validate!" => \$validate,
                    "format-patch!" => \$format_patch,
                    "8bit-encoding=s" => \$auto_8bit_encoding,
 +                  "force" => \$force,
         );
  
  unless ($rc) {
@@@ -705,16 -703,6 +706,16 @@@ if (!defined $auto_8bit_encoding && sca
                                  default => "UTF-8");
  }
  
 +if (!$force) {
 +      for my $f (@files) {
 +              if (get_patch_subject($f) =~ /\*\*\* SUBJECT HERE \*\*\*/) {
 +                      die "Refusing to send because the patch\n\t$f\n"
 +                              . "has the template subject '*** SUBJECT HERE ***'. "
 +                              . "Pass --force if you really want to send.\n";
 +              }
 +      }
 +}
 +
  my $prompting = 0;
  if (!defined $sender) {
        $sender = $repoauthor || $repocommitter || '';
@@@ -908,7 -896,7 +909,7 @@@ sub sanitize_address 
  
  sub valid_fqdn {
        my $domain = shift;
 -      return !($^O eq 'darwin' && $domain =~ /\.local$/) && $domain =~ /\./;
 +      return defined $domain && !($^O eq 'darwin' && $domain =~ /\.local$/) && $domain =~ /\./;
  }
  
  sub maildomain_net {
@@@ -953,7 -941,7 +954,7 @@@ sub maildomain 
  sub send_message {
        my @recipients = unique_email_list(@to);
        @cc = (grep { my $cc = extract_valid_address($_);
 -                    not grep { $cc eq $_ } @recipients
 +                    not grep { $cc eq $_ || $_ =~ /<\Q${cc}\E>$/ } @recipients
                    }
               map { sanitize_address($_) }
               @cc);
diff --combined git-svn.perl
index 18cfb2466d11aa28a795e3dabac70e236061fbe9,d2922245aa76448e551a4b427e7c8c721527952d..757de82161e05b9d12c489efeff05c7fec341fe4
@@@ -1,6 -1,7 +1,7 @@@
  #!/usr/bin/env perl
  # Copyright (C) 2006, Eric Wong <normalperson@yhbt.net>
  # License: GPL v2 or later
+ use 5.008;
  use warnings;
  use strict;
  use vars qw/  $AUTHOR $VERSION
@@@ -1513,8 -1514,7 +1514,8 @@@ sub cmt_sha2rev_batch 
  
  sub working_head_info {
        my ($head, $refs) = @_;
 -      my @args = ('log', '--no-color', '--first-parent', '--pretty=medium');
 +      my @args = qw/log --no-color --no-decorate --first-parent
 +                    --pretty=medium/;
        my ($fh, $ctx) = command_output_pipe(@args, $head);
        my $hash;
        my %max;
@@@ -3119,10 -3119,9 +3120,10 @@@ sub _rev_list 
  sub check_cherry_pick {
        my $base = shift;
        my $tip = shift;
 +      my $parents = shift;
        my @ranges = @_;
        my %commits = map { $_ => 1 }
 -              _rev_list("--no-merges", $tip, "--not", $base);
 +              _rev_list("--no-merges", $tip, "--not", $base, @$parents);
        for my $range ( @ranges ) {
                delete @commits{_rev_list($range)};
        }
@@@ -3298,7 -3297,6 +3299,7 @@@ sub find_extra_svn_parents 
                # double check that there are no missing non-merge commits
                my (@incomplete) = check_cherry_pick(
                        $merge_base, $merge_tip,
 +                      $parents,
                        @$ranges,
                       );