author | Lars Hjemli <hjemli@gmail.com> | 2009-08-23 20:58:39 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2009-08-24 08:22:58 (UTC) |
commit | e7af002d5c405c82652f739d08ced3908d1f57e7 (patch) (unidiff) | |
tree | 1e31e5dd8d33ca4a8392c4d6207b2ff6bf8a0d76 | |
parent | 50d5af3adcdd90424b70e9472af24356ed50aa9b (diff) | |
download | cgit-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>
-rw-r--r-- | cgit.c | 4 | ||||
-rw-r--r-- | cgit.css | 2 | ||||
-rw-r--r-- | cgit.h | 4 | ||||
-rw-r--r-- | cgitrc.5.txt | 9 | ||||
-rw-r--r-- | shared.c | 2 | ||||
-rw-r--r-- | ui-repolist.c | 18 |
6 files changed, 22 insertions, 17 deletions
@@ -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")) |
@@ -431,3 +431,3 @@ table.diff td div.del { | |||
431 | 431 | ||
432 | table.list td.repogroup { | 432 | table.list td.reposection { |
433 | font-style: italic; | 433 | font-style: italic; |
@@ -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:: | |||
202 | repo.group:: | 202 | repo.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 | ||
228 | section: | ||
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 | |||
228 | snapshots:: | 233 | snapshots:: |
@@ -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); |