summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--ui-commit.c6
-rw-r--r--ui-shared.c2
-rw-r--r--ui-shared.h2
3 files changed, 8 insertions, 2 deletions
diff --git a/ui-commit.c b/ui-commit.c
index c2fafd7..dd36cc0 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -154,48 +154,54 @@ void cgit_print_commit(char *hex)
return;
}
commit = lookup_commit_reference(sha1);
if (!commit) {
cgit_print_error(fmt("Bad commit reference: %s", hex));
return;
}
info = cgit_parse_commit(commit);
html("<table summary='commit info' class='commit-info'>\n");
html("<tr><th>author</th><td>");
html_txt(info->author);
html(" ");
html_txt(info->author_email);
html("</td><td class='right'>");
cgit_print_date(info->author_date, FMT_LONGDATE);
html("</td></tr>\n");
html("<tr><th>committer</th><td>");
html_txt(info->committer);
html(" ");
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,
ctx.qry.head, tmp, NULL);
html("</td></tr>\n");
for (p = commit->parents; p ; p = p->next) {
parent = lookup_commit_reference(p->item->object.sha1);
if (!parent) {
html("<tr><td colspan='3'>");
cgit_print_error("Error reading parent commit");
html("</td></tr>");
continue;
}
html("<tr><th>parent</th>"
"<td colspan='2' class='sha1'>");
cgit_commit_link(sha1_to_hex(p->item->object.sha1), NULL, NULL,
ctx.qry.head, sha1_to_hex(p->item->object.sha1));
html(" (");
cgit_diff_link("diff", NULL, NULL, ctx.qry.head, hex,
sha1_to_hex(p->item->object.sha1), NULL);
html(")</td></tr>");
}
if (ctx.repo->snapshots) {
html("<tr><th>download</th><td colspan='2' class='sha1'>");
diff --git a/ui-shared.c b/ui-shared.c
index 6253a90..bb08c4a 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -520,50 +520,48 @@ void cgit_print_pageheader(struct cgit_context *ctx)
*/
else {
html(">");
html_txt("a fast webinterface for the git dscm");
}
html("</td></tr>\n");
html("</tr>\n");
html("</table>\n");
html("<table class='tabs'><tr><td>\n");
if (ctx->repo) {
reporevlink(NULL, "summary", NULL, hc(cmd, "summary"),
ctx->qry.head, NULL, NULL);
cgit_refs_link("refs", NULL, hc(cmd, "refs"), ctx->qry.head,
ctx->qry.sha1, NULL);
cgit_log_link("log", NULL, hc(cmd, "log"), ctx->qry.head,
NULL, NULL, 0, NULL, NULL);
cgit_tree_link("tree", NULL, hc(cmd, "tree"), ctx->qry.head,
ctx->qry.sha1, NULL);
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)
html_attr(cgit_fileurl(ctx->qry.repo, "log",
ctx->qry.path, NULL));
html("'>\n");
add_hidden_formfields(1, 0, "log");
html("<select name='qt'>\n");
html_option("grep", "log msg", ctx->qry.grep);
html_option("author", "author", ctx->qry.grep);
html_option("committer", "committer", ctx->qry.grep);
html("</select>\n");
html("<input class='txt' type='text' size='10' name='q' value='");
html_attr(ctx->qry.search);
html("'/>\n");
html("<input type='submit' value='search'/>\n");
html("</form>\n");
} else {
html("<a class='active' href='");
html_attr(cgit_rooturl());
html("'>index</a>\n");
html("</td><td class='form'>");
html("<form method='get' action='");
html_attr(cgit_rooturl());
diff --git a/ui-shared.h b/ui-shared.h
index 94de884..76c2b1f 100644
--- a/ui-shared.h
+++ b/ui-shared.h
@@ -1,36 +1,38 @@
#ifndef UI_SHARED_H
#define UI_SHARED_H
extern char *cgit_repourl(const char *reponame);
extern char *cgit_fileurl(const char *reponame, const char *pagename,
const char *filename, const char *query);
extern char *cgit_pageurl(const char *reponame, const char *pagename,
const char *query);
extern void cgit_tree_link(char *name, char *title, char *class, char *head,
char *rev, char *path);
extern void cgit_log_link(char *name, char *title, char *class, char *head,
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,
char *head, char *rev, char *archivename);
extern void cgit_diff_link(char *name, char *title, char *class, char *head,
char *new_rev, char *old_rev, char *path);
extern void cgit_object_link(struct object *obj);
extern void cgit_print_error(char *msg);
extern void cgit_print_date(time_t secs, char *format);
extern void cgit_print_age(time_t t, time_t max_relative, char *format);
extern void cgit_print_http_headers(struct cgit_context *ctx);
extern void cgit_print_docstart(struct cgit_context *ctx);
extern void cgit_print_docend();
extern void cgit_print_pageheader(struct cgit_context *ctx);
extern void cgit_print_filemode(unsigned short mode);
extern void cgit_print_snapshot_links(const char *repo, const char *head,
const char *hex, int snapshots);
#endif /* UI_SHARED_H */