Merge branch 'jc/perl' into next
* jc/perl: cvsimport: avoid open "-|" list form for Perl 5.6 svnimport: avoid open "-|" list form for Perl 5.6 send-email: avoid open "-|" list form for Perl 5.6 rerere: avoid open "-|" list form for Perl 5.6 fmt-merge-msg: avoid open "-|" list form for Perl 5.6
This commit is contained in:
commit
98968450b2
@ -846,8 +846,12 @@ while(<CVS>) {
|
||||
print "Drop $fn\n" if $opt_v;
|
||||
} else {
|
||||
print "".($init ? "New" : "Update")." $fn: $size bytes\n" if $opt_v;
|
||||
open my $F, '-|', "git-hash-object -w $tmpname"
|
||||
my $pid = open(my $F, '-|');
|
||||
die $! unless defined $pid;
|
||||
if (!$pid) {
|
||||
exec("git-hash-object", "-w", $tmpname)
|
||||
or die "Cannot create object: $!\n";
|
||||
}
|
||||
my $sha = <$F>;
|
||||
chomp $sha;
|
||||
close $F;
|
||||
|
@ -28,11 +28,12 @@ sub andjoin {
|
||||
}
|
||||
|
||||
sub repoconfig {
|
||||
my $fh;
|
||||
my $val;
|
||||
eval {
|
||||
open $fh, '-|', 'git-repo-config', '--get', 'merge.summary'
|
||||
or die "$!";
|
||||
my $pid = open(my $fh, '-|');
|
||||
if (!$pid) {
|
||||
exec('git-repo-config', '--get', 'merge.summary');
|
||||
}
|
||||
($val) = <$fh>;
|
||||
close $fh;
|
||||
};
|
||||
@ -41,25 +42,32 @@ sub repoconfig {
|
||||
|
||||
sub current_branch {
|
||||
my $fh;
|
||||
open $fh, '-|', 'git-symbolic-ref', 'HEAD' or die "$!";
|
||||
my $pid = open($fh, '-|');
|
||||
die "$!" unless defined $pid;
|
||||
if (!$pid) {
|
||||
exec('git-symbolic-ref', 'HEAD') or die "$!";
|
||||
}
|
||||
my ($bra) = <$fh>;
|
||||
chomp($bra);
|
||||
close $fh or die "$!";
|
||||
$bra =~ s|^refs/heads/||;
|
||||
if ($bra ne 'master') {
|
||||
$bra = " into $bra";
|
||||
} else {
|
||||
$bra = "";
|
||||
}
|
||||
|
||||
return $bra;
|
||||
}
|
||||
|
||||
sub shortlog {
|
||||
my ($tip, $limit) = @_;
|
||||
my ($fh, @result);
|
||||
open $fh, '-|', ('git-log', "--max-count=$limit", '--topo-order',
|
||||
'--pretty=oneline', $tip, '^HEAD')
|
||||
or die "$!";
|
||||
my $pid = open($fh, '-|');
|
||||
die "$!" unless defined $pid;
|
||||
if (!$pid) {
|
||||
exec('git-log', "--max-count=$limit", '--topo-order',
|
||||
'--pretty=oneline', $tip, '^HEAD') or die "$!";
|
||||
}
|
||||
while (<$fh>) {
|
||||
s/^[0-9a-f]{40}\s+//;
|
||||
push @result, $_;
|
||||
|
@ -131,7 +131,11 @@ sub record_preimage {
|
||||
sub find_conflict {
|
||||
my $in;
|
||||
local $/ = "\0";
|
||||
open $in, '-|', qw(git ls-files -z -u) or die "$!: ls-files";
|
||||
my $pid = open($in, '-|');
|
||||
die "$!" unless defined $pid;
|
||||
if (!$pid) {
|
||||
exec(qw(git ls-files -z -u)) or die "$!: ls-files";
|
||||
}
|
||||
my %path = ();
|
||||
my @path = ();
|
||||
while (<$in>) {
|
||||
|
@ -59,24 +59,29 @@ my $rc = GetOptions("from=s" => \$from,
|
||||
|
||||
# Now, let's fill any that aren't set in with defaults:
|
||||
|
||||
open(GITVAR,"-|","git-var","-l")
|
||||
or die "Failed to open pipe from git-var: $!";
|
||||
|
||||
my ($author,$committer);
|
||||
while(<GITVAR>) {
|
||||
chomp;
|
||||
my ($var,$data) = split /=/,$_,2;
|
||||
my @fields = split /\s+/, $data;
|
||||
|
||||
my $ident = join(" ", @fields[0...(@fields-3)]);
|
||||
|
||||
if ($var eq 'GIT_AUTHOR_IDENT') {
|
||||
$author = $ident;
|
||||
} elsif ($var eq 'GIT_COMMITTER_IDENT') {
|
||||
$committer = $ident;
|
||||
}
|
||||
sub gitvar {
|
||||
my ($var) = @_;
|
||||
my $fh;
|
||||
my $pid = open($fh, '-|');
|
||||
die "$!" unless defined $pid;
|
||||
if (!$pid) {
|
||||
exec('git-var', $var) or die "$!";
|
||||
}
|
||||
my ($val) = <$fh>;
|
||||
close $fh or die "$!";
|
||||
chomp($val);
|
||||
return $val;
|
||||
}
|
||||
close(GITVAR);
|
||||
|
||||
sub gitvar_ident {
|
||||
my ($name) = @_;
|
||||
my $val = gitvar($name);
|
||||
my @field = split(/\s+/, $val);
|
||||
return join(' ', @field[0...(@field-3)]);
|
||||
}
|
||||
|
||||
my ($author) = gitvar_ident('GIT_AUTHOR_IDENT');
|
||||
my ($committer) = gitvar_ident('GIT_COMMITTER_IDENT');
|
||||
|
||||
my $prompting = 0;
|
||||
if (!defined $from) {
|
||||
|
@ -10,7 +10,6 @@
|
||||
# The head revision is on branch "origin" by default.
|
||||
# You can change that with the '-o' option.
|
||||
|
||||
require 5.008; # for shell-safe open("-|",LIST)
|
||||
use strict;
|
||||
use warnings;
|
||||
use Getopt::Std;
|
||||
@ -322,8 +321,12 @@ sub get_file($$$) {
|
||||
return undef unless defined $name;
|
||||
}
|
||||
|
||||
open my $F, '-|', "git-hash-object", "-w", $name
|
||||
my $pid = open(my $F, '-|');
|
||||
die $! unless defined $pid;
|
||||
if (!$pid) {
|
||||
exec("git-hash-object", "-w", $name)
|
||||
or die "Cannot create object: $!\n";
|
||||
}
|
||||
my $sha = <$F>;
|
||||
chomp $sha;
|
||||
close $F;
|
||||
@ -398,7 +401,12 @@ sub copy_path($$$$$$$$) {
|
||||
$srcpath =~ s#/*$#/#;
|
||||
}
|
||||
|
||||
open my $f,"-|","git-ls-tree","-r","-z",$gitrev,$srcpath;
|
||||
my $pid = open my $f,'-|';
|
||||
die $! unless defined $pid;
|
||||
if (!$pid) {
|
||||
exec("git-ls-tree","-r","-z",$gitrev,$srcpath)
|
||||
or die $!;
|
||||
}
|
||||
local $/ = "\0";
|
||||
while(<$f>) {
|
||||
chomp;
|
||||
@ -554,7 +562,11 @@ sub commit {
|
||||
@o1 = @old;
|
||||
@old = ();
|
||||
}
|
||||
open my $F, "-|", "git-ls-files", "-z", @o1 or die $!;
|
||||
my $pid = open my $F, "-|";
|
||||
die "$!" unless defined $pid;
|
||||
if (!$pid) {
|
||||
exec("git-ls-files", "-z", @o1) or die $!;
|
||||
}
|
||||
@o1 = ();
|
||||
local $/ = "\0";
|
||||
while(<$F>) {
|
||||
|
Loading…
Reference in New Issue
Block a user