git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH(resend)] gitweb: Allow configuring the default projects order and add order 'none'
@ 2007-04-06 21:58 Frank Lichtenheld
  2007-04-07  0:51 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Frank Lichtenheld @ 2007-04-06 21:58 UTC (permalink / raw
  To: git; +Cc: Jakub Narebski, Junio C Hamano, Frank Lichtenheld

Introduce new configuration variable $default_projects_order
that can be used to specify the default order of projects on
the index page if no 'o' parameter is given.

Allow a new value 'none' for order that will cause the projects
to be in the order we learned about them. In case of reading the
list of projects from a file, this should be the order as they are
listed in the file. In case of reading the list of projects from
a directory this will probably give random results depending on the
filesystem in use.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
---
 gitweb/gitweb.perl |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

Directly send after the other patch the first time, too, and equally
lost.

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 379c89c..1d265ea 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -71,6 +71,10 @@ our $logo_label = "git homepage";
 # source of projects list
 our $projects_list = "++GITWEB_LIST++";
 
+# default order of projects list
+# valid values are none, project, descr, owner, and age
+our $default_projects_order = "project";
+
 # show repository only if this file exists
 # (only effective if this variable evaluates to true)
 our $export_ok = "++GITWEB_EXPORT_OK++";
@@ -1131,7 +1135,6 @@ sub git_get_projects_list {
 		}
 		close $fd;
 	}
-	@list = sort {$a->{'path'} cmp $b->{'path'}} @list;
 	return @list;
 }
 
@@ -2618,7 +2621,7 @@ sub git_project_list_body {
 		push @projects, $pr;
 	}
 
-	$order ||= "project";
+	$order ||= $default_projects_order;
 	$from = 0 unless defined $from;
 	$to = $#projects if (!defined $to || $#projects < $to);
 
@@ -2977,7 +2980,7 @@ sub git_search_grep_body {
 
 sub git_project_list {
 	my $order = $cgi->param('o');
-	if (defined $order && $order !~ m/project|descr|owner|age/) {
+	if (defined $order && $order !~ m/none|project|descr|owner|age/) {
 		die_error(undef, "Unknown order parameter");
 	}
 
@@ -3000,7 +3003,7 @@ sub git_project_list {
 
 sub git_forks {
 	my $order = $cgi->param('o');
-	if (defined $order && $order !~ m/project|descr|owner|age/) {
+	if (defined $order && $order !~ m/none|project|descr|owner|age/) {
 		die_error(undef, "Unknown order parameter");
 	}
 
-- 
1.5.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH(resend)] gitweb: Allow configuring the default projects order and add order 'none'
  2007-04-06 21:58 [PATCH(resend)] gitweb: Allow configuring the default projects order and add order 'none' Frank Lichtenheld
@ 2007-04-07  0:51 ` Junio C Hamano
  2007-04-10 13:30   ` Petr Baudis
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2007-04-07  0:51 UTC (permalink / raw
  To: Petr Baudis; +Cc: git, Jakub Narebski, Frank Lichtenheld

Both of these two patches from Frank seem sane to me, but I
think I'd ask your Ack before applying, as repo.or.cz is
probably the heaviest user of the 'fork' feature.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH(resend)] gitweb: Allow configuring the default projects order and add order 'none'
  2007-04-07  0:51 ` Junio C Hamano
@ 2007-04-10 13:30   ` Petr Baudis
  0 siblings, 0 replies; 3+ messages in thread
From: Petr Baudis @ 2007-04-10 13:30 UTC (permalink / raw
  To: Junio C Hamano; +Cc: git, Jakub Narebski, Frank Lichtenheld

On Sat, Apr 07, 2007 at 02:51:44AM CEST, Junio C Hamano wrote:
> Both of these two patches from Frank seem sane to me, but I
> think I'd ask your Ack before applying, as repo.or.cz is
> probably the heaviest user of the 'fork' feature.

Acked-by: Petr Baudis <pasky@suse.cz>

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Ever try. Ever fail. No matter. // Try again. Fail again. Fail better.
		-- Samuel Beckett

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-04-10 13:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-06 21:58 [PATCH(resend)] gitweb: Allow configuring the default projects order and add order 'none' Frank Lichtenheld
2007-04-07  0:51 ` Junio C Hamano
2007-04-10 13:30   ` Petr Baudis

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).