all repos — cgit @ 39912a24edf45497e668ebda25636aa6f6db0c9b

a hyperfast web frontend for git written in c

Remove 'patch' link from tab, add to commit view

It's a bit confusing to enter the patch view from the tab, since it has no
layout. And the commit view has always lacked showing the commit id. Both of
these warts are fixed by this commit, which adds a new header line in the
commit view which shows the commit id as a 'permalink' to the current commit
and also adds a link to the patch view of the current commit.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Lars Hjemli hjemli@gmail.com
Sun, 13 Apr 2008 12:20:00 +0200
commit

39912a24edf45497e668ebda25636aa6f6db0c9b

parent

536b0541fcfea2169e4df33043cd9ff14c657bce

3 files changed, 8 insertions(+), 2 deletions(-)

jump to
M ui-commit.cui-commit.c

@@ -175,6 +175,12 @@ html_txt(info->committer_email);

html("</td><td class='right'>"); cgit_print_date(info->committer_date, FMT_LONGDATE); html("</td></tr>\n"); + html("<tr><th>commit</th><td colspan='2' class='sha1'>"); + tmp = sha1_to_hex(commit->object.sha1); + cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp); + html(" ("); + cgit_patch_link("patch", NULL, NULL, NULL, tmp); + html(")</td></tr>\n"); html("<tr><th>tree</th><td colspan='2' class='sha1'>"); tmp = xstrdup(hex); cgit_tree_link(sha1_to_hex(commit->tree->object.sha1), NULL, NULL,
M ui-shared.cui-shared.c

@@ -541,8 +541,6 @@ cgit_commit_link("commit", NULL, hc(cmd, "commit"),

ctx->qry.head, ctx->qry.sha1); cgit_diff_link("diff", NULL, hc(cmd, "diff"), ctx->qry.head, ctx->qry.sha1, ctx->qry.sha2, NULL); - cgit_patch_link("patch", NULL, hc(cmd, "patch"), ctx->qry.head, - ctx->qry.sha1); html("</td><td class='form'>"); html("<form class='right' method='get' action='"); if (ctx->cfg.virtual_root)
M ui-shared.hui-shared.h

@@ -14,6 +14,8 @@ char *rev, char *path, int ofs, char *grep,

char *pattern); extern void cgit_commit_link(char *name, char *title, char *class, char *head, char *rev); +extern void cgit_patch_link(char *name, char *title, char *class, char *head, + char *rev); extern void cgit_refs_link(char *name, char *title, char *class, char *head, char *rev, char *path); extern void cgit_snapshot_link(char *name, char *title, char *class,