git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 8/8] gitweb: Use rev-list --skip option.

From
RFRobert Fitzsimons <robfitz@273k.net>
Date
Dec 24, 2006, 14:31 UTC
Message-ID
<11669707123843-git-send-email-robfitz@273k.net>
In-Reply-To
<11669707111273-git-send-email-robfitz@273k.net>
Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
---
 gitweb/gitweb.perl |   24 +-----------------------
 1 files changed, 1 insertions(+), 23 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index f9994d9..65fcdb0 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -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) : ())
-- 
1.4.4.3.ge655-dirty
Previous: Robert FitzsimonsNext: Jakub Narebski
Message 8 of 10 in “gitweb: Add parse_commits, used to bulk load commit objects.”
  1. 1/8 gitweb: Add parse_commits, used to bulk load commit objects.Robert Fitzsimons, Dec 24, 2006
  2. 2/8 gitweb: We do longer need the --parents flag in rev-list.Robert Fitzsimons, Dec 24, 2006
  3. 3/8 gitweb: Change summary, shortlog actions to use parse_commits.Robert Fitzsimons, Dec 24, 2006
  4. 4/8 gitweb: Change log action to use parse_commits.Robert Fitzsimons, Dec 24, 2006
  5. 5/8 gitweb: Change header search action to use parse_commits.Robert Fitzsimons, Dec 24, 2006
  6. 6/8 gitweb: Change atom, rss actions to use parse_commits.Robert Fitzsimons, Dec 24, 2006
  7. 7/8 gitweb: Change history action to use parse_commits.Robert Fitzsimons, Dec 24, 2006
  8. 8/8 gitweb: Use rev-list --skip option.Robert Fitzsimons, Dec 24, 2006
  9. Jakub NarebskiDec 25, 2006
  10. gitweb: Re-enable rev-list --parents for parse_commit.Robert Fitzsimons, Dec 27, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.