mirror of
https://git.zx2c4.com/cgit
synced 2025-07-15 04:34:33 +02:00
ui-repolist: Allow sections to be collapsible
The index page can be difficult to navigate for really large git servers. This change allows a configuration like: section-collapse=people section-collapse=tests And an index page would only display the "people" and "tests" section headers entries (not their repos) with a hyperlink that can be used to drill down into each section. Additionally the boolean logic around displaying sections in ui-repolist.c was simplified to eliminate an impossible condition. Signed-off-by: Andy Doan <andy.doan@linaro.org> Reviewed-by: John Keeping <john@keeping.me.uk> Signed-off-by: John Keeping <john@keeping.me.uk>
This commit is contained in:
parent
84b158abe0
commit
1a66e7f3c1
6 changed files with 63 additions and 24 deletions
|
@ -164,10 +164,10 @@ static void add_repo(const char *base, struct strbuf *path, repo_config_fn fn)
|
|||
}
|
||||
if (slash && !n) {
|
||||
*slash = '\0';
|
||||
repo->section = xstrdup(rel.buf);
|
||||
repo->section = get_or_create_section(rel.buf);
|
||||
*slash = '/';
|
||||
if (starts_with(repo->name, repo->section)) {
|
||||
repo->name += strlen(repo->section);
|
||||
if (starts_with(repo->name, repo->section->name)) {
|
||||
repo->name += strlen(repo->section->name);
|
||||
if (*repo->name == '/')
|
||||
repo->name++;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue