From mboxrd@z Thu Jan 1 00:00:00 1970 From: cgit at cryptocrack.de (Lukas Fleischer) Date: Thu, 4 Jun 2015 13:32:41 +0200 Subject: [PATCH] Customize cgit for the AUR Message-ID: <1433417561-29419-1-git-send-email-cgit@cryptocrack.de> From: Lukas Fleischer * 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 --- 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(""); html("
"); 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(""); 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(""); 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(""); - html("
\n"); - cgit_add_hidden_formfields(0, 1, ctx.qry.page); - html(" "); - html(""); - html("
"); - } + html_txt("AUR : "); + html_txt(ctx.qry.head); + html_txt(".git"); } else html_txt(ctx.cfg.root_title); html("\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(""); - cgit_print_branches(ctx.cfg.summary_branches); - htmlf("", columns); cgit_print_tags(ctx.cfg.summary_tags); if (ctx.cfg.summary_log > 0) { htmlf("", columns); -- 2.4.2