From: Junio C Hamano <junkio@cox.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Eric Wong <normalperson@yhbt.net>, git@vger.kernel.org
Subject: [PATCH] fmt-merge-msg: avoid open "-|" list form for Perl 5.6
Date: Mon, 20 Feb 2006 14:05:51 -0800 [thread overview]
Message-ID: <7vr75xbs8w.fsf_-_@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <20060220191011.GA18085@hand.yhbt.net> (Eric Wong's message of "Mon, 20 Feb 2006 11:10:12 -0800")
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
* Eric, thanks for the hint. I have this four-patch series.
Could people with perl 5.6 please check them?
git-fmt-merge-msg.perl | 24 ++++++++++++++++--------
1 files changed, 16 insertions(+), 8 deletions(-)
615782c9609bf23be55b403e994d88c1047be996
diff --git a/git-fmt-merge-msg.perl b/git-fmt-merge-msg.perl
index c34ddc5..a77e94e 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, $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, $_;
--
1.2.2.g5be4ea
next prev parent reply other threads:[~2006-02-20 22:06 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-20 18:37 Should we support Perl 5.6? Johannes Schindelin
2006-02-20 19:10 ` Eric Wong
2006-02-20 21:01 ` Andreas Ericsson
2006-02-20 21:15 ` Junio C Hamano
2006-02-20 22:05 ` Junio C Hamano [this message]
2006-02-20 22:12 ` [PATCH] rerere: avoid open "-|" list form for Perl 5.6 Junio C Hamano
2006-02-20 22:12 ` [PATCH] send-email: " Junio C Hamano
2006-02-20 22:12 ` [PATCH] svmimport: " Junio C Hamano
2006-02-20 22:19 ` [PATCH] cvsimport: " Junio C Hamano
2006-02-21 17:30 ` [PATCH] fmt-merge-msg: " Alex Riesen
2006-02-21 20:36 ` Sam Vilain
2006-02-21 21:57 ` Alex Riesen
2006-02-21 22:19 ` Johannes Schindelin
2006-02-21 22:35 ` Eric Wong
2006-02-21 22:38 ` Shawn Pearce
2006-02-21 23:00 ` Martin Langhoff
2006-02-21 22:38 ` Sam Vilain
2006-02-22 16:35 ` Alex Riesen
2006-02-22 19:44 ` Johannes Schindelin
2006-02-22 19:51 ` Sam Vilain
2006-02-22 19:54 ` Junio C Hamano
2006-02-22 22:00 ` Johannes Schindelin
2006-02-22 22:25 ` Junio C Hamano
2006-02-23 8:00 ` Alex Riesen
2006-02-23 8:45 ` Junio C Hamano
2006-02-23 9:35 ` Alex Riesen
2006-02-23 9:41 ` Alex Riesen
2006-02-23 9:48 ` Andreas Ericsson
2006-02-23 10:10 ` Alex Riesen
2006-02-23 13:29 ` Andreas Ericsson
2006-02-23 14:07 ` Alex Riesen
2006-02-23 14:22 ` Andreas Ericsson
2006-02-23 17:13 ` Linus Torvalds
2006-02-23 19:32 ` Junio C Hamano
2006-02-23 19:38 ` Johannes Schindelin
2006-02-23 19:54 ` Linus Torvalds
2006-02-23 20:19 ` Johannes Schindelin
2006-02-23 19:51 ` Linus Torvalds
2006-02-23 20:31 ` Sam Vilain
2006-02-24 6:43 ` Linus Torvalds
2006-02-23 21:43 ` Alex Riesen
2006-02-26 19:55 ` Christopher Faylor
2006-02-26 20:18 ` Linus Torvalds
2006-02-26 20:40 ` Christopher Faylor
2006-03-02 14:18 ` Alex Riesen
2006-03-02 15:18 ` Mark Wooding
2006-03-02 16:11 ` Alex Riesen
2006-03-02 15:22 ` Christopher Faylor
2006-03-02 16:20 ` Alex Riesen
2006-02-26 23:17 ` NT directory traversal speed on 25K files on Cygwin Rutger Nijlunsing
2006-02-27 1:18 ` Christopher Faylor
2006-02-27 18:30 ` Rutger Nijlunsing
2006-02-27 18:34 ` Christopher Faylor
2006-02-27 9:19 ` Andreas Ericsson
2006-02-27 18:45 ` Rutger Nijlunsing
2006-03-02 13:40 ` Alex Riesen
2006-03-02 14:10 ` [PATCH] fmt-merge-msg: avoid open "-|" list form for Perl 5.6 Alex Riesen
2006-03-02 15:00 ` Christopher Faylor
2006-03-02 16:10 ` Alex Riesen
2006-03-02 17:39 ` Andreas Ericsson
2006-03-02 22:01 ` Alex Riesen
2006-02-26 20:33 ` Christopher Faylor
2006-02-24 12:02 ` Eric Wong
2006-02-24 13:44 ` Johannes Schindelin
2006-02-24 16:14 ` Linus Torvalds
2006-02-21 20:56 ` Eric Wong
2006-02-21 22:04 ` Alex Riesen
[not found] ` <1cf1c57a0602211412r1988b14ao435edd29207dc0d0@mail.gmail.com>
2006-02-21 22:13 ` Ron Parker
-- strict thread matches above, loose matches on Subject: below --
2006-03-02 16:44 Christopher Faylor
2006-03-02 16:55 ` Shawn Pearce
2006-03-02 22:09 ` Alex Riesen
2006-03-02 23:27 ` Linus Torvalds
2006-03-03 0:34 ` Junio C Hamano
2006-03-03 0:49 ` Linus Torvalds
2006-03-03 1:25 ` Junio C Hamano
2006-03-03 1:52 ` Linus Torvalds
2006-03-03 0:14 ` Christopher Faylor
2006-03-02 17:33 ` Johannes Schindelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vr75xbs8w.fsf_-_@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=normalperson@yhbt.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.