summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 98214e9)
raw | patch | inline | side by side (parent: 98214e9)
author | Alex Riesen <raa.lkml@gmail.com> | |
Thu, 23 Feb 2006 10:26:46 +0000 (11:26 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 23 Feb 2006 11:49:09 +0000 (03:49 -0800) |
It also makes it work on ActiveState Perl.
Signed-off-by: Junio C Hamano <junkio@cox.net>
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 c13af4884abc9371250687cb2ab25b66a91acc48..dae383f231f4fc4dd5482b2e091da5fe80cfa35d 100755 (executable)
--- a/git-fmt-merge-msg.perl
+++ b/git-fmt-merge-msg.perl
}
sub repoconfig {
- my $val;
- eval {
- my $pid = open(my $fh, '-|');
- if (!$pid) {
- exec('git-repo-config', '--get', 'merge.summary');
- }
- ($val) = <$fh>;
- close $fh;
- };
+ my ($val) = qx{git-repo-config --get merge.summary};
return $val;
}
sub current_branch {
- my $fh;
- my $pid = open($fh, '-|');
- die "$!" unless defined $pid;
- if (!$pid) {
- exec('git-symbolic-ref', 'HEAD') or die "$!";
- }
- my ($bra) = <$fh>;
+ my ($bra) = qx{git-symbolic-ref HEAD};
chomp($bra);
- close $fh or die "$!";
$bra =~ s|^refs/heads/||;
if ($bra ne 'master') {
$bra = " into $bra";
sub shortlog {
my ($tip) = @_;
- my ($fh, @result);
- my $pid = open($fh, '-|');
- die "$!" unless defined $pid;
- if (!$pid) {
- exec('git-log', '--topo-order',
- '--pretty=oneline', $tip, '^HEAD') or die "$!";
- }
- while (<$fh>) {
+ my @result;
+ foreach ( qx{git-log --topo-order --pretty=oneline $tip ^HEAD} ) {
s/^[0-9a-f]{40}\s+//;
push @result, $_;
}
- close $fh or die "$!";
+ die "git-log failed\n" if $?;
return @result;
}