summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.c5
-rw-r--r--cgit.css5
-rw-r--r--cgit.h4
-rw-r--r--ui-commit.c3
-rw-r--r--ui-log.c8
-rw-r--r--ui-tree.c25
6 files changed, 37 insertions, 13 deletions
diff --git a/cgit.c b/cgit.c
index 3d85a08..9e63d18 100644
--- a/cgit.c
+++ b/cgit.c
@@ -110,5 +110,6 @@ static void cgit_print_repo_page(struct cacheitem *item)
110 cgit_print_log(cgit_query_head, cgit_query_ofs, 110 cgit_print_log(cgit_query_head, cgit_query_ofs,
111 cgit_max_commit_count, cgit_query_search); 111 cgit_max_commit_count, cgit_query_search,
112 cgit_query_path);
112 } else if (!strcmp(cgit_query_page, "tree")) { 113 } else if (!strcmp(cgit_query_page, "tree")) {
113 cgit_print_tree(cgit_query_sha1, cgit_query_path); 114 cgit_print_tree(cgit_query_head, cgit_query_sha1, cgit_query_path);
114 } else if (!strcmp(cgit_query_page, "commit")) { 115 } else if (!strcmp(cgit_query_page, "commit")) {
diff --git a/cgit.css b/cgit.css
index fe0ba50..6231e28 100644
--- a/cgit.css
+++ b/cgit.css
@@ -191,2 +191,7 @@ td.filesize {
191 191
192td.links {
193 font-size: 80%;
194 padding-left: 2em;
195}
196
192td.filemode { 197td.filemode {
diff --git a/cgit.h b/cgit.h
index 93699b5..0fff7b0 100644
--- a/cgit.h
+++ b/cgit.h
@@ -171,6 +171,6 @@ extern void cgit_print_repolist(struct cacheitem *item);
171extern void cgit_print_summary(); 171extern void cgit_print_summary();
172extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep); 172extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *path);
173extern void cgit_print_view(const char *hex, char *path); 173extern void cgit_print_view(const char *hex, char *path);
174extern void cgit_print_blob(struct cacheitem *item, const char *hex, char *path); 174extern void cgit_print_blob(struct cacheitem *item, const char *hex, char *path);
175extern void cgit_print_tree(const char *hex, char *path); 175extern void cgit_print_tree(const char *rev, const char *hex, char *path);
176extern void cgit_print_commit(const char *hex); 176extern void cgit_print_commit(const char *hex);
diff --git a/ui-commit.c b/ui-commit.c
index b3d1c28..20a7cb2 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -188,3 +188,4 @@ void cgit_print_commit(const char *hex)
188 html("<tr><th>tree</th><td colspan='2' class='sha1'><a href='"); 188 html("<tr><th>tree</th><td colspan='2' class='sha1'><a href='");
189 query = fmt("id=%s", sha1_to_hex(commit->tree->object.sha1)); 189 query = fmt("h=%s&id=%s", sha1_to_hex(commit->object.sha1),
190 sha1_to_hex(commit->tree->object.sha1));
190 html_attr(cgit_pageurl(cgit_query_repo, "tree", query)); 191 html_attr(cgit_pageurl(cgit_query_repo, "tree", query));
diff --git a/ui-log.c b/ui-log.c
index 7d1985e..6d5509b 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -55,3 +55,3 @@ void print_commit(struct commit *commit)
55 55
56void cgit_print_log(const char *tip, int ofs, int cnt, char *grep) 56void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *path)
57{ 57{
@@ -59,3 +59,3 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep)
59 struct commit *commit; 59 struct commit *commit;
60 const char *argv[3] = {NULL, tip, NULL}; 60 const char *argv[] = {NULL, tip, NULL, NULL, NULL};
61 int argc = 2; 61 int argc = 2;
@@ -65,2 +65,6 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep)
65 argv[argc++] = fmt("--grep=%s", grep); 65 argv[argc++] = fmt("--grep=%s", grep);
66 if (path) {
67 argv[argc++] = "--";
68 argv[argc++] = path;
69 }
66 init_revisions(&rev, NULL); 70 init_revisions(&rev, NULL);
diff --git a/ui-tree.c b/ui-tree.c
index dee8309..db63e13 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -10,5 +10,6 @@
10 10
11char *curr_rev;
11 12
12static int print_entry(const unsigned char *sha1, const char *base, 13static int print_entry(const unsigned char *sha1, const char *base,
13 int baselen, const char *pathname, unsigned int mode, 14 int baselen, const char *pathname, unsigned int mode,
14 int stage) 15 int stage)
@@ -37,4 +38,5 @@ static int print_entry(const unsigned char *sha1, const char *base,
37 html("class='ls-dir'><a href='"); 38 html("class='ls-dir'><a href='");
38 html_attr(cgit_pageurl(cgit_query_repo, "tree", 39 html_attr(cgit_pageurl(cgit_query_repo, "tree",
39 fmt("id=%s&path=%s%s/", 40 fmt("h=%s&id=%s&path=%s%s/",
41 curr_rev,
40 sha1_to_hex(sha1), 42 sha1_to_hex(sha1),
@@ -45,3 +47,4 @@ static int print_entry(const unsigned char *sha1, const char *base,
45 html_attr(cgit_pageurl(cgit_query_repo, "view", 47 html_attr(cgit_pageurl(cgit_query_repo, "view",
46 fmt("id=%s&path=%s%s", sha1_to_hex(sha1), 48 fmt("h=%s&id=%s&path=%s%s", curr_rev,
49 sha1_to_hex(sha1),
47 cgit_query_path ? cgit_query_path : "", 50 cgit_query_path ? cgit_query_path : "",
@@ -51,2 +54,10 @@ static int print_entry(const unsigned char *sha1, const char *base,
51 htmlf("<td class='filesize'>%li</td>", size); 54 htmlf("<td class='filesize'>%li</td>", size);
55
56 html("<td class='links'><a href='");
57 html_attr(cgit_pageurl(cgit_query_repo, "log",
58 fmt("h=%s&path=%s%s",
59 curr_rev,
60 cgit_query_path ? cgit_query_path : "",
61 pathname)));
62 html("'>history</a></td>");
52 html("</tr>\n"); 63 html("</tr>\n");
@@ -56,3 +67,3 @@ static int print_entry(const unsigned char *sha1, const char *base,
56 67
57void cgit_print_tree(const char *hex, char *path) 68void cgit_print_tree(const char *rev, const char *hex, char *path)
58{ 69{
@@ -61,2 +72,3 @@ void cgit_print_tree(const char *hex, char *path)
61 72
73 curr_rev = xstrdup(rev);
62 if (get_sha1_hex(hex, sha1)) { 74 if (get_sha1_hex(hex, sha1)) {
@@ -77,2 +89,3 @@ void cgit_print_tree(const char *hex, char *path)
77 html("<th class='right'>Size</th>"); 89 html("<th class='right'>Size</th>");
90 html("<th/>");
78 html("</tr>\n"); 91 html("</tr>\n");