summaryrefslogtreecommitdiffabout
authorLars Hjemli <hjemli@gmail.com>2009-08-23 20:58:39 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2009-08-24 08:22:58 (UTC)
commite7af002d5c405c82652f739d08ced3908d1f57e7 (patch) (unidiff)
tree1e31e5dd8d33ca4a8392c4d6207b2ff6bf8a0d76
parent50d5af3adcdd90424b70e9472af24356ed50aa9b (diff)
downloadcgit-e7af002d5c405c82652f739d08ced3908d1f57e7.zip
cgit-e7af002d5c405c82652f739d08ced3908d1f57e7.tar.gz
cgit-e7af002d5c405c82652f739d08ced3908d1f57e7.tar.bz2
Introduce 'section' as canonical spelling for 'repo.group'
The 'repo.' prefix should be reserved for repo-specific options, but the option 'repo.group' must still be honored to stay backwards compatible. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.c4
-rw-r--r--cgit.css2
-rw-r--r--cgit.h4
-rw-r--r--cgitrc.5.txt9
-rw-r--r--shared.c2
-rw-r--r--ui-repolist.c18
6 files changed, 22 insertions, 17 deletions
diff --git a/cgit.c b/cgit.c
index a792fe4..013a0fe 100644
--- a/cgit.c
+++ b/cgit.c
@@ -145,4 +145,4 @@ void config_cb(const char *name, const char *value)
145 add_mimetype(name + 9, value); 145 add_mimetype(name + 9, value);
146 else if (!strcmp(name, "repo.group")) 146 else if (!strcmp(name, "section") || !strcmp(name, "repo.group"))
147 ctx.cfg.repo_group = xstrdup(value); 147 ctx.cfg.section = xstrdup(value);
148 else if (!strcmp(name, "repo.url")) 148 else if (!strcmp(name, "repo.url"))
diff --git a/cgit.css b/cgit.css
index e3b32e7..3c65114 100644
--- a/cgit.css
+++ b/cgit.css
@@ -431,3 +431,3 @@ table.diff td div.del {
431 431
432table.list td.repogroup { 432table.list td.reposection {
433 font-style: italic; 433 font-style: italic;
diff --git a/cgit.h b/cgit.h
index 5659580..fc7c7d5 100644
--- a/cgit.h
+++ b/cgit.h
@@ -67,5 +67,5 @@ struct cgit_repo {
67 char *defbranch; 67 char *defbranch;
68 char *group;
69 char *module_link; 68 char *module_link;
70 char *readme; 69 char *readme;
70 char *section;
71 char *clone_url; 71 char *clone_url;
@@ -158,3 +158,2 @@ struct cgit_config {
158 char *module_link; 158 char *module_link;
159 char *repo_group;
160 char *robots; 159 char *robots;
@@ -164,2 +163,3 @@ struct cgit_config {
164 char *script_name; 163 char *script_name;
164 char *section;
165 char *virtual_root; 165 char *virtual_root;
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index 2abbd41..4d009f9 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -202,4 +202,4 @@ renamelimit::
202repo.group:: 202repo.group::
203 A value for the current repository group, which all repositories 203 Legacy alias for 'section' which will be deprecated starting with
204 specified after this setting will inherit. Default value: none. 204 cgit-1.0.
205 205
@@ -227,2 +227,7 @@ scan-path::
227 227
228section:
229 The name of the current repository section - all repositories defined
230 after this option will inherit the current section name. Default value:
231 none.
232
228snapshots:: 233snapshots::
diff --git a/shared.c b/shared.c
index 4cb9573..9475581 100644
--- a/shared.c
+++ b/shared.c
@@ -55,3 +55,3 @@ struct cgit_repo *cgit_add_repo(const char *url)
55 ret->owner = NULL; 55 ret->owner = NULL;
56 ret->group = ctx.cfg.repo_group; 56 ret->section = ctx.cfg.section;
57 ret->defbranch = "master"; 57 ret->defbranch = "master";
diff --git a/ui-repolist.c b/ui-repolist.c
index 7c7aa9b..4dea3b3 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -205,3 +205,3 @@ void cgit_print_repolist()
205 int i, columns = 4, hits = 0, header = 0; 205 int i, columns = 4, hits = 0, header = 0;
206 char *last_group = NULL; 206 char *last_section = NULL;
207 int sorted = 0; 207 int sorted = 0;
@@ -235,14 +235,14 @@ void cgit_print_repolist()
235 if (!sorted && 235 if (!sorted &&
236 ((last_group == NULL && ctx.repo->group != NULL) || 236 ((last_section == NULL && ctx.repo->section != NULL) ||
237 (last_group != NULL && ctx.repo->group == NULL) || 237 (last_section != NULL && ctx.repo->section == NULL) ||
238 (last_group != NULL && ctx.repo->group != NULL && 238 (last_section != NULL && ctx.repo->section != NULL &&
239 strcmp(ctx.repo->group, last_group)))) { 239 strcmp(ctx.repo->section, last_section)))) {
240 htmlf("<tr class='nohover'><td colspan='%d' class='repogroup'>", 240 htmlf("<tr class='nohover'><td colspan='%d' class='reposection'>",
241 columns); 241 columns);
242 html_txt(ctx.repo->group); 242 html_txt(ctx.repo->section);
243 html("</td></tr>"); 243 html("</td></tr>");
244 last_group = ctx.repo->group; 244 last_section = ctx.repo->section;
245 } 245 }
246 htmlf("<tr><td class='%s'>", 246 htmlf("<tr><td class='%s'>",
247 !sorted && ctx.repo->group ? "sublevel-repo" : "toplevel-repo"); 247 !sorted && ctx.repo->section ? "sublevel-repo" : "toplevel-repo");
248 cgit_summary_link(ctx.repo->name, ctx.repo->name, NULL, NULL); 248 cgit_summary_link(ctx.repo->name, ctx.repo->name, NULL, NULL);