]> granicus.if.org Git - cgit/commitdiff
Introduce 'section' as canonical spelling for 'repo.group'
authorLars Hjemli <hjemli@gmail.com>
Sun, 23 Aug 2009 20:58:39 +0000 (22:58 +0200)
committerLars Hjemli <hjemli@gmail.com>
Mon, 24 Aug 2009 08:22:58 +0000 (10:22 +0200)
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>
cgit.c
cgit.css
cgit.h
cgitrc.5.txt
shared.c
ui-repolist.c

diff --git a/cgit.c b/cgit.c
index a792fe46eaf73d842a16dbca127ddbe6b43a96f0..013a0feb3a3f36923c7cf59c76c964d690edaaf8 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -143,8 +143,8 @@ void config_cb(const char *name, const char *value)
                ctx.cfg.local_time = atoi(value);
        else if (!prefixcmp(name, "mimetype."))
                add_mimetype(name + 9, value);
-       else if (!strcmp(name, "repo.group"))
-               ctx.cfg.repo_group = xstrdup(value);
+       else if (!strcmp(name, "section") || !strcmp(name, "repo.group"))
+               ctx.cfg.section = xstrdup(value);
        else if (!strcmp(name, "repo.url"))
                ctx.repo = cgit_add_repo(value);
        else if (!strcmp(name, "repo.name"))
index e3b32e75c0d8a4c14aed2dbc8ee80c75bd1d9209..3c65114edb76bf8e7381328b6facd517abfecafd 100644 (file)
--- a/cgit.css
+++ b/cgit.css
@@ -429,7 +429,7 @@ table.diff td div.del {
        text-align: right;
 }
 
-table.list td.repogroup {
+table.list td.reposection {
        font-style: italic;
        color: #888;
 }
diff --git a/cgit.h b/cgit.h
index 565958056517da0f76ab07977809334cc0ae0520..fc7c7d59358ea89a5d3b3afe6a8309d7c045eab5 100644 (file)
--- a/cgit.h
+++ b/cgit.h
@@ -65,9 +65,9 @@ struct cgit_repo {
        char *desc;
        char *owner;
        char *defbranch;
-       char *group;
        char *module_link;
        char *readme;
+       char *section;
        char *clone_url;
        int snapshots;
        int enable_log_filecount;
@@ -156,12 +156,12 @@ struct cgit_config {
        char *logo;
        char *logo_link;
        char *module_link;
-       char *repo_group;
        char *robots;
        char *root_title;
        char *root_desc;
        char *root_readme;
        char *script_name;
+       char *section;
        char *virtual_root;
        int cache_size;
        int cache_dynamic_ttl;
index 2abbd4146bf77d862860f559235ca5fa91aa0891..4d009f9d943cd5922e1105fc035171db09efc494 100644 (file)
@@ -200,8 +200,8 @@ renamelimit::
          `man git-diff`). Default value: "-1".
 
 repo.group::
-       A value for the current repository group, which all repositories
-       specified after this setting will inherit. Default value: none.
+       Legacy alias for 'section' which will be deprecated starting with
+       cgit-1.0.
 
 robots::
        Text used as content for the "robots" meta-tag. Default value:
@@ -225,6 +225,11 @@ scan-path::
        the result will be cached as a cgitrc include-file in the cache
        directory. Default value: none. See also: cache-scanrc-ttl.
 
+section:
+       The name of the current repository section - all repositories defined
+       after this option will inherit the current section name. Default value:
+       none.
+
 snapshots::
        Text which specifies the default set of snapshot formats generated by
        cgit. The value is a space-separated list of zero or more of the
index 4cb95739c197d28b9fa381ff192d09cba7f5c473..9475581b2c4a20d73b639223156b8a7afbd5b5ca 100644 (file)
--- a/shared.c
+++ b/shared.c
@@ -53,7 +53,7 @@ struct cgit_repo *cgit_add_repo(const char *url)
        ret->path = NULL;
        ret->desc = "[no description]";
        ret->owner = NULL;
-       ret->group = ctx.cfg.repo_group;
+       ret->section = ctx.cfg.section;
        ret->defbranch = "master";
        ret->snapshots = ctx.cfg.snapshots;
        ret->enable_log_filecount = ctx.cfg.enable_log_filecount;
index 7c7aa9bc28a714047ad2863319eb2ad52bc5ea5b..4dea3b37a4a9317af7a75ad425ce32bfeee6ddd5 100644 (file)
@@ -203,7 +203,7 @@ int sort_repolist(char *field)
 void cgit_print_repolist()
 {
        int i, columns = 4, hits = 0, header = 0;
-       char *last_group = NULL;
+       char *last_section = NULL;
        int sorted = 0;
 
        if (ctx.cfg.enable_index_links)
@@ -233,18 +233,18 @@ void cgit_print_repolist()
                if (!header++)
                        print_header(columns);
                if (!sorted &&
-                   ((last_group == NULL && ctx.repo->group != NULL) ||
-                   (last_group != NULL && ctx.repo->group == NULL) ||
-                   (last_group != NULL && ctx.repo->group != NULL &&
-                    strcmp(ctx.repo->group, last_group)))) {
-                       htmlf("<tr class='nohover'><td colspan='%d' class='repogroup'>",
+                   ((last_section == NULL && ctx.repo->section != NULL) ||
+                   (last_section != NULL && ctx.repo->section == NULL) ||
+                   (last_section != NULL && ctx.repo->section != NULL &&
+                    strcmp(ctx.repo->section, last_section)))) {
+                       htmlf("<tr class='nohover'><td colspan='%d' class='reposection'>",
                              columns);
-                       html_txt(ctx.repo->group);
+                       html_txt(ctx.repo->section);
                        html("</td></tr>");
-                       last_group = ctx.repo->group;
+                       last_section = ctx.repo->section;
                }
                htmlf("<tr><td class='%s'>",
-                     !sorted && ctx.repo->group ? "sublevel-repo" : "toplevel-repo");
+                     !sorted && ctx.repo->section ? "sublevel-repo" : "toplevel-repo");
                cgit_summary_link(ctx.repo->name, ctx.repo->name, NULL, NULL);
                html("</td><td>");
                html_link_open(cgit_repourl(ctx.repo->url), NULL, NULL);