summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cefda27)
raw | patch | inline | side by side (parent: cefda27)
author | Jakub Narebski <jnareb@gmail.com> | |
Sun, 30 Jul 2006 12:58:11 +0000 (14:58 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 31 Jul 2006 01:37:29 +0000 (18:37 -0700) |
Use 'my @lines = map { chomp; $_ } <$fd>;' form to read all lines of
git command output into array without trailing newlines.
It has advantage over 'chomp (my (@lines) = <$fd>);' in that it does
not modify array.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git command output into array without trailing newlines.
It has advantage over 'chomp (my (@lines) = <$fd>);' in that it does
not modify array.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.cgi | patch | blob | history |
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index e7ae65adfc8170ffb20b9fcf1d5cec9c86ead408..98505551cd3e2f5fb5eaf516e86ce16be6084fa5 100755 (executable)
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
"</table>\n";
open my $fd, "-|", $GIT, "rev-list", "--max-count=17", git_read_head($project)
or die_error(undef, "Open git-rev-list failed.");
- my (@revlist) = map { chomp; $_ } <$fd>;
+ my @revlist = map { chomp; $_ } <$fd>;
close $fd;
print "<div>\n" .
$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=shortlog"), -class => "title"}, "shortlog") .
$/ = "\0";
open my $fd, "-|", $GIT, "ls-tree", '-z', $hash
or die_error(undef, "Open git-ls-tree failed.");
- chomp (my (@entries) = <$fd>);
+ my @entries = map { chomp; $_ } <$fd>;
close $fd or die_error(undef, "Reading tree failed.");
$/ = "\n";
# http://www.notestips.com/80256B3A007F2692/1/NAMO5P9UPQ
open my $fd, "-|", $GIT, "rev-list", "--max-count=150", git_read_head($project)
or die_error(undef, "Open git-rev-list failed.");
- my (@revlist) = map { chomp; $_ } <$fd>;
+ my @revlist = map { chomp; $_ } <$fd>;
close $fd or die_error(undef, "Reading rev-list failed.");
print $cgi->header(-type => 'text/xml', -charset => 'utf-8');
print "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n".
my $limit = sprintf("--max-count=%i", (100 * ($page+1)));
open my $fd, "-|", $GIT, "rev-list", $limit, $hash
or die_error(undef, "Open git-rev-list failed.");
- my (@revlist) = map { chomp; $_ } <$fd>;
+ my @revlist = map { chomp; $_ } <$fd>;
close $fd;
if ($hash ne $head || $page) {
my %ad = date_str($co{'author_epoch'}, $co{'author_tz'});
my %cd = date_str($co{'committer_epoch'}, $co{'committer_tz'});
- my @difftree;
my $parent = $co{'parent'};
if (!defined $parent) {
$parent = "--root";
}
open my $fd, "-|", $GIT, "diff-tree", '-r', '-M', $parent, $hash
or die_error(undef, "Open git-diff-tree failed.");
- @difftree = map { chomp; $_ } <$fd>;
+ my @difftree = map { chomp; $_ } <$fd>;
close $fd or die_error(undef, "Reading git-diff-tree failed.");
# non-textual hash id's can be cached
}
open my $fd, "-|", $GIT, "diff-tree", '-r', $hash_parent, $hash
or die_error(undef, "Open git-diff-tree failed.");
- my (@difftree) = map { chomp; $_ } <$fd>;
+ my @difftree = map { chomp; $_ } <$fd>;
close $fd or die_error(undef, "Reading diff-tree failed.");
# non-textual hash id's can be cached
mkdir($git_temp, 0700);
open my $fd, "-|", $GIT, "diff-tree", '-r', $hash_parent, $hash
or die_error(undef, "Open git-diff-tree failed.");
- my (@difftree) = map { chomp; $_ } <$fd>;
+ my @difftree = map { chomp; $_ } <$fd>;
close $fd or die_error(undef, "Reading diff-tree failed.");
# try to figure out the next tag after this commit
my $tagname;
my $refs = read_info_ref("tags");
open $fd, "-|", $GIT, "rev-list", "HEAD";
- chomp (my (@commits) = <$fd>);
+ my @commits = map { chomp; $_ } <$fd>;
close $fd;
foreach my $commit (@commits) {
if (defined $refs->{$commit}) {
my $limit = sprintf("--max-count=%i", (100 * ($page+1)));
open my $fd, "-|", $GIT, "rev-list", $limit, $hash
or die_error(undef, "Open git-rev-list failed.");
- my (@revlist) = map { chomp; $_ } <$fd>;
+ my @revlist = map { chomp; $_ } <$fd>;
close $fd;
if ($hash ne $head || $page) {