From d71c0c725d7b5ddfc5b788d328a5fc7a27739662 Mon Sep 17 00:00:00 2001 From: Benjamin Close Date: Tue, 25 Nov 2008 06:25:35 -0800 Subject: Add support for sorting by Age in the repolist Signed-off-by: Lars Hjemli --- cgit.h | 1 + 1 file changed, 1 insertion(+) (limited to 'cgit.h') diff --git a/cgit.h b/cgit.h index 91db98a..ea90833 100644 --- a/cgit.h +++ b/cgit.h @@ -121,6 +121,7 @@ struct cgit_query { char *url; int ofs; int nohead; + char *sort; }; struct cgit_config { -- cgit v1.2.3-24-g4f1b From 8813170390f3c3a0f4743afbc92ede42953fa3b0 Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Sat, 29 Nov 2008 16:46:37 +0100 Subject: ui-repolist: implement lazy caching of repo->mtime When sorting the list of repositories by their last modification time, cgit would (in the worst case) invoke fstat(3) four times and open(3) twice for each callback from qsort(3). This obviously scales very badly. Now, the calculated modtime for each repo is saved in repo->mtime, thus keeping the number of stat/open invocations identical for sorted and unsorted repo-listings. Signed-off-by: Lars Hjemli --- cgit.h | 1 + 1 file changed, 1 insertion(+) (limited to 'cgit.h') diff --git a/cgit.h b/cgit.h index ea90833..c99d337 100644 --- a/cgit.h +++ b/cgit.h @@ -61,6 +61,7 @@ struct cgit_repo { int snapshots; int enable_log_filecount; int enable_log_linecount; + time_t mtime; }; struct cgit_repolist { -- cgit v1.2.3-24-g4f1b