X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/9927e63f387e6c9328eb3c347ecb0e339f8ac023..dc3ac3f76077c5d612d42e8beb4878e43acfc58a:/ui-commit.c
diff --git a/ui-commit.c b/ui-commit.c
index b6a106f..ff1fad3 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -29,7 +29,6 @@ void print_fileinfo(struct fileinfo *info)
{
char *query, *query2;
char *class;
- double width;
switch (info->status) {
case DIFF_STATUS_ADDED:
@@ -96,18 +95,15 @@ void print_fileinfo(struct fileinfo *info)
}
html("
");
htmlf("%d", info->added + info->removed);
-
html(" | ");
- width = (info->added + info->removed) * 100.0 / max_changes;
- if (width < 0.1)
- width = 0.1;
- html_link_open(cgit_pageurl(cgit_query_repo, "diff", query),
- NULL, NULL);
- htmlf(" ",
- info->added * width / (info->added + info->removed));
- htmlf(" ",
- info->removed * width / (info->added + info->removed));
- html(" | \n");
+ htmlf("", (max_changes > 100 ? 100 : max_changes));
+ htmlf(" | ",
+ info->added * 100.0 / max_changes);
+ htmlf(" | ",
+ info->removed * 100.0 / max_changes);
+ htmlf(" | ",
+ (max_changes - info->removed - info->added) * 100.0 / max_changes);
+ html("
\n");
}
void cgit_count_diff_lines(char *line, int len)
@@ -201,7 +197,7 @@ void cgit_print_commit(const char *hex)
html("| parent | "
""
"%s (Diffstat");
html("");
max_changes = 0;
cgit_diff_commit(commit, inspect_filepair);
@@ -232,8 +229,11 @@ void cgit_print_commit(const char *hex)
print_fileinfo(&items[i]);
html(" ");
html("");
- htmlf("%d files changed, %d insertions, %d deletions\n",
+ htmlf("%d files changed, %d insertions, %d deletions (",
files, total_adds, total_rems);
+ query = fmt("h=%s", hex);
+ html_link_open(cgit_pageurl(cgit_query_repo, "diff", query), NULL, NULL);
+ html("show diff)");
html(" ");
}
cgit_free_commitinfo(info);
|
|---|