List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH 1/3] Added "sort-sections" flag for the repository listing
@ 2012-07-02 15:38 Tobias.Bieniek
  2012-07-02 15:38 ` [PATCH 2/3] Added "date-order" and "topo-order" flags Tobias.Bieniek
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Tobias.Bieniek @ 2012-07-02 15:38 UTC (permalink / raw)


Flag which, when set to "1", will make sort the sections on the
repository listing by name. Set this flag to "0" if the order in the
cgitrc file should be preserved. Default value: "1".
---
 cgit.c        |    3 +++
 cgit.h        |    1 +
 cgitrc.5.txt  |    5 +++++
 ui-repolist.c |    2 +-
 4 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/cgit.c b/cgit.c
index b9b3a66..4ec00f6 100644
--- a/cgit.c
+++ b/cgit.c
@@ -229,6 +229,8 @@ void config_cb(const char *name, const char *value)
 		ctx.cfg.scan_hidden_path = atoi(value);
 	else if (!strcmp(name, "section-from-path"))
 		ctx.cfg.section_from_path = atoi(value);
+	else if (!strcmp(name, "sort-sections"))
+		ctx.cfg.sort_sections = atoi(value);
 	else if (!strcmp(name, "source-filter"))
 		ctx.cfg.source_filter = new_filter(value, SOURCE);
 	else if (!strcmp(name, "summary-log"))
@@ -355,6 +357,7 @@ static void prepare_context(struct cgit_context *ctx)
 	ctx->cfg.scan_hidden_path = 0;
 	ctx->cfg.script_name = CGIT_SCRIPT_NAME;
 	ctx->cfg.section = "";
+	ctx->cfg.sort_sections = 1;
 	ctx->cfg.summary_branches = 10;
 	ctx->cfg.summary_log = 10;
 	ctx->cfg.summary_tags = 10;
diff --git a/cgit.h b/cgit.h
index 6ee6769..86afad1 100644
--- a/cgit.h
+++ b/cgit.h
@@ -224,6 +224,7 @@ struct cgit_config {
 	int scan_hidden_path;
 	int section_from_path;
 	int snapshots;
+	int sort_sections;
 	int summary_branches;
 	int summary_log;
 	int summary_tags;
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index a72241f..3e2d87f 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -336,6 +336,11 @@ snapshots::
 	values "tar", "tar.gz", "tar.bz2", "tar.xz" and "zip". Default value:
 	none.
 
+sort-sections::
+	Flag which, when set to "1", will make sort the sections on the
+	repository listing by name. Set this flag to "0" if the order in the
+	cgitrc file should be preserved. Default value: "1".
+
 source-filter::
 	Specifies a command which will be invoked to format plaintext blobs
 	in the tree view. The command will get the blob content on its STDIN
diff --git a/ui-repolist.c b/ui-repolist.c
index d946f32..4cf3ec1 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -237,7 +237,7 @@ void cgit_print_repolist()
 
 	if(ctx.qry.sort)
 		sorted = sort_repolist(ctx.qry.sort);
-	else
+	else if (ctx.cfg.sort_sections)
 		sort_repolist("section");
 
 	html("<table summary='repository list' class='list nowrap'>");
-- 
1.7.10





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

end of thread, other threads:[~2012-10-13 14:24 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-02 15:38 [PATCH 1/3] Added "sort-sections" flag for the repository listing Tobias.Bieniek
2012-07-02 15:38 ` [PATCH 2/3] Added "date-order" and "topo-order" flags Tobias.Bieniek
2012-07-02 15:38 ` [PATCH 3/3] Fixed parameter parsing in repo_config() function Tobias.Bieniek
     [not found] ` <CABEOeT=yfWaqRfanCcgVYLkTa3PD8JtkfvY2NfTGxNOAO2PEFQ@mail.gmail.com>
2012-10-08 21:11   ` [PATCH 1/3] Added "sort-sections" flag for the repository listing Jason
2012-10-09 18:59     ` Tobias.Bieniek
2012-10-09 19:03       ` Jason
2012-10-09 19:10         ` Jason
2012-10-09 19:11           ` Jason
2012-10-09 21:54             ` Tobias.Bieniek
2012-10-09 22:16               ` Jason
2012-10-09 21:49           ` Tobias.Bieniek
2012-10-09 22:15             ` Jason
2012-10-09 22:26               ` Tobias.Bieniek
2012-10-13 14:24           ` Tobias.Bieniek
2012-10-09 21:47         ` Tobias.Bieniek
2012-10-09 19:12       ` Jason

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 NNTP newsgroup(s).