Skip to content

Commit

Permalink
gitweb: Use rev-list --skip option.
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Robert Fitzsimons authored and Junio C Hamano committed Dec 25, 2006
1 parent a8b983b commit f47efbb
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -1391,35 +1391,13 @@ sub parse_commits {
$maxcount ||= 1;
$skip ||= 0;

# Delete once rev-list supports the --skip option
if ($skip > 0) {
open my $fd, "-|", git_cmd(), "rev-list",
($arg ? ($arg) : ()),
("--max-count=" . ($maxcount + $skip)),
$commit_id,
"--",
($filename ? ($filename) : ())
or die_error(undef, "Open git-rev-list failed");
while (my $line = <$fd>) {
if ($skip-- <= 0) {
chomp $line;
my %co = parse_commit($line);
push @cos, \%co;
}
}
close $fd;

return wantarray ? @cos : \@cos;
}

local $/ = "\0";

open my $fd, "-|", git_cmd(), "rev-list",
"--header",
($arg ? ($arg) : ()),
("--max-count=" . $maxcount),
# Add once rev-list supports the --skip option
# ("--skip=" . $skip),
("--skip=" . $skip),
$commit_id,
"--",
($filename ? ($filename) : ())
Expand Down

0 comments on commit f47efbb

Please sign in to comment.