]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-log.c
ui-log.c: allow commit range as search expression
[ps-cgit] / ui-log.c
index f3132c964c16a9d909ee13937bd4db670de79fde..4441d1d55025405e47d69f07ee79176c510fa111 100644 (file)
--- a/ui-log.c
+++ b/ui-log.c
@@ -66,7 +66,7 @@ void show_commit_decorations(struct commit *commit)
                else {
                        strncpy(buf, deco->name, sizeof(buf) - 1);
                        cgit_commit_link(buf, NULL, "deco", ctx.qry.head,
-                               sha1_to_hex(commit->object.sha1));
+                               sha1_to_hex(commit->object.sha1), 0);
                }
                deco = deco->next;
        }
@@ -89,7 +89,7 @@ void print_commit(struct commit *commit)
        htmlf("</td><td%s>",
                ctx.qry.showmsg ? " class='logsubject'" : "");
        cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head,
-                        sha1_to_hex(commit->object.sha1));
+                        sha1_to_hex(commit->object.sha1), 0);
        show_commit_decorations(commit);
        html("</td><td>");
        html_txt(info->author);
@@ -146,10 +146,13 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
 
        argv[1] = disambiguate_ref(tip);
 
-       if (grep && pattern && (!strcmp(grep, "grep") ||
-                               !strcmp(grep, "author") ||
-                               !strcmp(grep, "committer")))
-               argv[argc++] = fmt("--%s=%s", grep, pattern);
+       if (grep && pattern) {
+               if (!strcmp(grep, "grep") || !strcmp(grep, "author") ||
+                   !strcmp(grep, "committer"))
+                       argv[argc++] = fmt("--%s=%s", grep, pattern);
+               if (!strcmp(grep, "range"))
+                       argv[1] = pattern;
+       }
 
        if (path) {
                argv[argc++] = "--";