]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-log.c
ui-tree: add link to stats page per path
[ps-cgit] / ui-log.c
index 9b2ffb68d8b088b3f396d1d12f741a626af495b8..8dd8b898c4deadb9c89dc53f070c2f22e0f56eb0 100644 (file)
--- a/ui-log.c
+++ b/ui-log.c
@@ -34,10 +34,15 @@ void inspect_files(struct diff_filepair *pair)
 void print_commit(struct commit *commit)
 {
        struct commitinfo *info;
+       char *tmp;
 
        info = cgit_parse_commit(commit);
        html("<tr><td>");
+       tmp = fmt("id=%s", sha1_to_hex(commit->object.sha1));
+       tmp = cgit_pageurl(ctx.repo->url, "commit", tmp);
+       html_link_open(tmp, NULL, NULL);
        cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE);
+       html_link_close();
        html("</td><td>");
        cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head,
                         sha1_to_hex(commit->object.sha1));
@@ -87,10 +92,8 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
        rev.verbose_header = 1;
        rev.show_root_diff = 0;
        setup_revisions(argc, argv, &rev, NULL);
-       if (rev.grep_filter) {
-               rev.grep_filter->regflags |= REG_ICASE;
-               compile_grep_patterns(rev.grep_filter);
-       }
+       rev.grep_filter.regflags |= REG_ICASE;
+       compile_grep_patterns(&rev.grep_filter);
        prepare_revision_walk(&rev);
 
        if (pager)