Sorting gitweb's project list by age ('Last Change') currently shows
projects with undefined ages at the head of the list. This results in a
less useful result when there are a number of projects that are missing
or otherwise faulty and one is trying to see what projects have been
updated recently.

Fix by sorting these projects with undefined ages at the bottom of the
list when sorting by age.

Signed-off-by: Matthew Daley <>
I realize this might be a bit bikesheddy, but it does improve the listing
in the given use case. For an example of the problem, see ie. or;o=age .

I'm also not a Perl native, so any advice on making the patch good Perl is

 gitweb/gitweb.perl |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 0f207f2..21da1b5 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -5541,7 +5541,9 @@ sub sort_projects_list {
        if ($oi->{'type'} eq 'str') {
                @projects = sort {$a->{$oi->{'key'}} cmp $b->{$oi->{'key'}}} 
        } else {
-               @projects = sort {$a->{$oi->{'key'}} <=> $b->{$oi->{'key'}}} 
+               @projects = sort {$a->{$oi->{'key'}} <=> $b->{$oi->{'key'}}}
+                           grep {defined $_->{$oi->{'key'}}} @$projlist;
+               push @projects, grep {!defined $_->{$oi->{'key'}}} @$projlist;
        return @projects;

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to