@matheusbsbs / matheus-bagliano / commits / f47efbb7ab
Fork 0

gitweb: Use rev-list --skip option.

Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>

Robert Fitzsimons committed Dec 24, 2006 at 14:31 UTC f47efbb7ab735fc49d8d93f9ed1c087c5da09c23
1 file changed +1 -23
gitweb/gitweb.perl
+1 -23
@@ -1391,35 +1391,13 @@ sub parse_commits {
1391 $maxcount ||= 1;
1392 $skip ||= 0;
1393
1394 - # Delete once rev-list supports the --skip option
1395 - if ($skip > 0) {
1396 - open my $fd, "-|", git_cmd(), "rev-list",
1397 - ($arg ? ($arg) : ()),
1398 - ("--max-count=" . ($maxcount + $skip)),
1399 - $commit_id,
1400 - "--",
1401 - ($filename ? ($filename) : ())
1402 - or die_error(undef, "Open git-rev-list failed");
1403 - while (my $line = <$fd>) {
1404 - if ($skip-- <= 0) {
1405 - chomp $line;
1406 - my %co = parse_commit($line);
1407 - push @cos, \%co;
1408 - }
1409 - }
1410 - close $fd;
1411 -
1412 - return wantarray ? @cos : \@cos;
1413 - }
1414 -
1394 local $/ = "\0";
1395
1396 open my $fd, "-|", git_cmd(), "rev-list",
1397 "--header",
1398 ($arg ? ($arg) : ()),
1399 ("--max-count=" . $maxcount),
1421 - # Add once rev-list supports the --skip option
1422 - # ("--skip=" . $skip),
1400 + ("--skip=" . $skip),
1401 $commit_id,
1402 "--",
1403 ($filename ? ($filename) : ())