{"thread":{"id":"7548","subject":"[PATCH(resend)] gitweb: Allow configuring the default projects order and add order 'none'","startedAt":"2007-04-06T21:58:24Z","lastAt":"2007-04-10T13:30:21Z","messageCount":3,"participants":["Frank Lichtenheld","Junio C Hamano","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"38807","messageId":"11758967042669-git-send-email-frank@lichtenheld.de","threadId":"7548","inReplyTo":null,"subject":"[PATCH(resend)] gitweb: Allow configuring the default projects order and add order 'none'","fromName":"Frank Lichtenheld","fromEmail":"frank@lichtenheld.de","sentAt":"2007-04-06T21:58:24Z","receivedAt":"2007-04-06T21:58:24Z","isPatch":true,"sender":{"key":"frank@lichtenheld.de","avatar":"https://gravatar.com/avatar/b9f1d4b120e138f157c9e480d0818197c474628923786adb98f30017cdb99c3c?d=mp&s=160"},"body":"Introduce new configuration variable $default_projects_order\nthat can be used to specify the default order of projects on\nthe index page if no 'o' parameter is given.\n\nAllow a new value 'none' for order that will cause the projects\nto be in the order we learned about them. In case of reading the\nlist of projects from a file, this should be the order as they are\nlisted in the file. In case of reading the list of projects from\na directory this will probably give random results depending on the\nfilesystem in use.\n\nSigned-off-by: Frank Lichtenheld <frank@lichtenheld.de>\n---\n gitweb/gitweb.perl |   11 +++++++----\n 1 files changed, 7 insertions(+), 4 deletions(-)\n\nDirectly send after the other patch the first time, too, and equally\nlost.\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 379c89c..1d265ea 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -71,6 +71,10 @@ our $logo_label = \"git homepage\";\n # source of projects list\n our $projects_list = \"++GITWEB_LIST++\";\n \n+# default order of projects list\n+# valid values are none, project, descr, owner, and age\n+our $default_projects_order = \"project\";\n+\n # show repository only if this file exists\n # (only effective if this variable evaluates to true)\n our $export_ok = \"++GITWEB_EXPORT_OK++\";\n@@ -1131,7 +1135,6 @@ sub git_get_projects_list {\n \t\t}\n \t\tclose $fd;\n \t}\n-\t@list = sort {$a->{'path'} cmp $b->{'path'}} @list;\n \treturn @list;\n }\n \n@@ -2618,7 +2621,7 @@ sub git_project_list_body {\n \t\tpush @projects, $pr;\n \t}\n \n-\t$order ||= \"project\";\n+\t$order ||= $default_projects_order;\n \t$from = 0 unless defined $from;\n \t$to = $#projects if (!defined $to || $#projects < $to);\n \n@@ -2977,7 +2980,7 @@ sub git_search_grep_body {\n \n sub git_project_list {\n \tmy $order = $cgi->param('o');\n-\tif (defined $order && $order !~ m/project|descr|owner|age/) {\n+\tif (defined $order && $order !~ m/none|project|descr|owner|age/) {\n \t\tdie_error(undef, \"Unknown order parameter\");\n \t}\n \n@@ -3000,7 +3003,7 @@ sub git_project_list {\n \n sub git_forks {\n \tmy $order = $cgi->param('o');\n-\tif (defined $order && $order !~ m/project|descr|owner|age/) {\n+\tif (defined $order && $order !~ m/none|project|descr|owner|age/) {\n \t\tdie_error(undef, \"Unknown order parameter\");\n \t}\n \n-- \n1.5.1\n"},{"id":"38829","messageId":"7vk5wpgg67.fsf@assigned-by-dhcp.cox.net","threadId":"7548","inReplyTo":"11758967042669-git-send-email-frank@lichtenheld.de","subject":"Re: [PATCH(resend)] gitweb: Allow configuring the default projects order and add order 'none'","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-04-07T00:51:44Z","receivedAt":"2007-04-07T00:51:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Both of these two patches from Frank seem sane to me, but I\nthink I'd ask your Ack before applying, as repo.or.cz is\nprobably the heaviest user of the 'fork' feature.\n"},{"id":"39002","messageId":"20070410133021.GK4489@pasky.or.cz","threadId":"7548","inReplyTo":"7vk5wpgg67.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH(resend)] gitweb: Allow configuring the default projects order and add order 'none'","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2007-04-10T13:30:21Z","receivedAt":"2007-04-10T13:30:21Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Sat, Apr 07, 2007 at 02:51:44AM CEST, Junio C Hamano wrote:\n> Both of these two patches from Frank seem sane to me, but I\n> think I'd ask your Ack before applying, as repo.or.cz is\n> probably the heaviest user of the 'fork' feature.\n\nAcked-by: Petr Baudis <pasky@suse.cz>\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nEver try. Ever fail. No matter. // Try again. Fail again. Fail better.\n\t\t-- Samuel Beckett\n"}]}