summaryrefslogtreecommitdiff
path: root/git-fmt-merge-msg.perl
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-02-22 06:51:21 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-02-22 06:51:21 (GMT)
commit6b98579babe767b343bf6e1448b52befd5fc0a2e (patch)
tree670d6a5c5667d72a148696e33b61dd81005c7640 /git-fmt-merge-msg.perl
parent155d12912fec6c60ead6d6c1febda5fa6e6eb128 (diff)
parentdd27478f092295069b148a4cfcf92fea9a4aab03 (diff)
downloadgit-6b98579babe767b343bf6e1448b52befd5fc0a2e.zip
git-6b98579babe767b343bf6e1448b52befd5fc0a2e.tar.gz
git-6b98579babe767b343bf6e1448b52befd5fc0a2e.tar.bz2
Merge branch 'jc/perl'
* 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
Diffstat (limited to 'git-fmt-merge-msg.perl')
-rwxr-xr-xgit-fmt-merge-msg.perl24
1 files changed, 16 insertions, 8 deletions
diff --git a/git-fmt-merge-msg.perl b/git-fmt-merge-msg.perl
index 3de67d7..c13af48 100755
--- a/git-fmt-merge-msg.perl
+++ b/git-fmt-merge-msg.perl
@@ -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) = @_;
my ($fh, @result);
- open $fh, '-|', ('git-log', '--topo-order',
- '--pretty=oneline', $tip, '^HEAD')
- or die "$!";
+ my $pid = open($fh, '-|');
+ die "$!" unless defined $pid;
+ if (!$pid) {
+ exec('git-log', '--topo-order',
+ '--pretty=oneline', $tip, '^HEAD') or die "$!";
+ }
while (<$fh>) {
s/^[0-9a-f]{40}\s+//;
push @result, $_;