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

[PATCH] gitweb: Sort the list of forks on the summary page by age

From
Petr Baudis <pasky@suse.cz>
Date
Sep 25, 2008, 16:48 UTC
Message-ID
<1222361328-17368-1-git-send-email-pasky@suse.cz>
In-Reply-To
<1222361317-17275-1-git-send-email-pasky@suse.cz>
From: Petr Baudis <pasky@suse.cz>
From: Mike Ralphson <mike@abacus.co.uk>

The list of forks on the summary page was unsorted, this just makes them sorted by age, which seems a fair way to decide which forks are shown before the list size cut-off (15) kicks in.

s/noheader/no_header was just to make it obvious what the parameter affects, so all the code can be found with one grep.

pb: As suggested by Mike, I have augmented this by an additional patch that refactors the sorting logic so that it is not tied to printing the headers.

Signed-off-by: Mike Ralphson <mike@abacus.co.uk>
Signed-off-by: Petr Baudis <pasky@suse.cz>
---
 gitweb/gitweb.perl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index bd81e14..0f8a564 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4119,10 +4119,10 @@ sub git_summary {
 
 	if (@forklist) {
 		git_print_header_div('forks');
-		git_project_list_body(\@forklist, undef, 0, 15,
+		git_project_list_body(\@forklist, 'age', 0, 15,
 		                      $#forklist <= 15 ? undef :
 		                      $cgi->a({-href => href(action=>"forks")}, "..."),
-		                      'noheader');
+		                      'no_header');
 	}
 
 	git_footer_html();
-- 
tg: (513dad1..) t/forks/sort-by-age (depends on: t/forks/sort-refactor)
Previous: Petr Baudis
Message 3 of 3 in “Gitweb; ordering of fork list on summary page (was Vanilla gitweb vs repo.or.cz)”
  1. Mike RalphsonJul 23, 2008
  2. gitweb: Clean-up sorting of project listPetr Baudis, Sep 25, 2008
  3. gitweb: Sort the list of forks on the summary page by agePetr Baudis, Sep 25, 2008

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.