[PATCH] Customize cgit for the AUR
Lukas Fleischer
cgit at cryptocrack.de
Thu Jun 4 13:32:41 CEST 2015
From: Lukas Fleischer <lfleischer at archlinux.org>
* Mention "AUR" and the package base in the title.
* Remove the branch switch form.
* Do not show any commit decorations.
* Do not show branches on the summary page.
* Drop link to the "refs" page.
* Use proper Git clone URLs.
Signed-off-by: Lukas Fleischer <lfleischer at archlinux.org>
---
ui-commit.c | 1 -
ui-log.c | 1 -
ui-shared.c | 28 +++++++---------------------
ui-summary.c | 2 --
4 files changed, 7 insertions(+), 25 deletions(-)
diff --git a/ui-commit.c b/ui-commit.c
index d5a888d..0c2c1f8 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -114,7 +114,6 @@ void cgit_print_commit(char *hex, const char *prefix)
cgit_open_filter(ctx.repo->commit_filter);
html_txt(info->subject);
cgit_close_filter(ctx.repo->commit_filter);
- show_commit_decorations(commit);
html("</div>");
html("<div class='commit-msg'>");
cgit_open_filter(ctx.repo->commit_filter);
diff --git a/ui-log.c b/ui-log.c
index 32b4c47..f855138 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -166,7 +166,6 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
}
cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head,
sha1_to_hex(commit->object.sha1), ctx.qry.vpath);
- show_commit_decorations(commit);
html("</td><td>");
cgit_open_filter(ctx.repo->email_filter, info->author_email, "log");
html_txt(info->author);
diff --git a/ui-shared.c b/ui-shared.c
index ac5a287..377032e 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -786,10 +786,10 @@ static void add_clone_urls(void (*fn)(const char *), char *txt, char *suffix)
void cgit_add_clone_urls(void (*fn)(const char *))
{
- if (ctx.repo->clone_url)
- add_clone_urls(fn, expand_macros(ctx.repo->clone_url), NULL);
- else if (ctx.cfg.clone_prefix)
- add_clone_urls(fn, ctx.cfg.clone_prefix, ctx.repo->url);
+ struct strbuf url = STRBUF_INIT;
+
+ strbuf_addf(&url, "%s/%s.git/", ctx.cfg.clone_prefix, ctx.qry.head);
+ add_clone_urls(fn, strbuf_detach(&url, NULL), NULL);
}
static int print_branch_option(const char *refname, const unsigned char *sha1,
@@ -886,21 +886,9 @@ static void print_header(void)
html("<td class='main'>");
if (ctx.repo) {
- cgit_index_link("index", NULL, NULL, NULL, NULL, 0, 1);
- html(" : ");
- cgit_summary_link(ctx.repo->name, ctx.repo->name, NULL, NULL);
- if (ctx.env.authenticated) {
- html("</td><td class='form'>");
- html("<form method='get' action=''>\n");
- cgit_add_hidden_formfields(0, 1, ctx.qry.page);
- html("<select name='h' onchange='this.form.submit();'>\n");
- for_each_branch_ref(print_branch_option, ctx.qry.head);
- if (ctx.repo->enable_remote_branches)
- for_each_remote_ref(print_branch_option, ctx.qry.head);
- html("</select> ");
- html("<input type='submit' name='' value='switch'/>");
- html("</form>");
- }
+ html_txt("AUR : ");
+ html_txt(ctx.qry.head);
+ html_txt(".git");
} else
html_txt(ctx.cfg.root_title);
html("</td></tr>\n");
@@ -933,8 +921,6 @@ void cgit_print_pageheader(void)
NULL);
cgit_summary_link("summary", NULL, hc("summary"),
ctx.qry.head);
- cgit_refs_link("refs", NULL, hc("refs"), ctx.qry.head,
- ctx.qry.sha1, NULL);
cgit_log_link("log", NULL, hc("log"), ctx.qry.head,
NULL, ctx.qry.vpath, 0, NULL, NULL,
ctx.qry.showmsg);
diff --git a/ui-summary.c b/ui-summary.c
index b0af073..e7ea890 100644
--- a/ui-summary.c
+++ b/ui-summary.c
@@ -50,8 +50,6 @@ void cgit_print_summary(void)
columns++;
html("<table summary='repository info' class='list nowrap'>");
- cgit_print_branches(ctx.cfg.summary_branches);
- htmlf("<tr class='nohover'><td colspan='%d'> </td></tr>", columns);
cgit_print_tags(ctx.cfg.summary_tags);
if (ctx.cfg.summary_log > 0) {
htmlf("<tr class='nohover'><td colspan='%d'> </td></tr>", columns);
--
2.4.2
More information about the CGit
mailing list