summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 551ce28)
raw | patch | inline | side by side (parent: 551ce28)
author | Junio C Hamano <junkio@cox.net> | |
Mon, 20 Feb 2006 22:02:25 +0000 (14:02 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 20 Feb 2006 22:21:10 +0000 (14:21 -0800) |
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-fmt-merge-msg.perl | patch | blob | history |
diff --git a/git-fmt-merge-msg.perl b/git-fmt-merge-msg.perl
index c34ddc5d5ec1b14ceb80fd699ad6b7c96e3f6b4c..a77e94eb5a8933cb43c8aa0707a7a345f14e97f5 100755 (executable)
--- a/git-fmt-merge-msg.perl
+++ b/git-fmt-merge-msg.perl
}
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;
};
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, $_;