diff --git a/.gitignore b/.gitignore index 7bde8c0..fae4661 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ build/ +cache/ *.o diff --git a/src/git_repo.cpp b/src/git_repo.cpp index e1c3a6a..ef9440f 100644 --- a/src/git_repo.cpp +++ b/src/git_repo.cpp @@ -480,6 +480,8 @@ std::vector GitRepo::log(const std::string &start_oid, int limit) co info.short_oid = info.oid.substr(0, SHORT_OID_LEN); const char *summary = git_commit_summary(commit); info.summary = summary ? summary : ""; + const char *body = git_commit_body(commit); + info.body = body ? body : ""; const git_signature *author = git_commit_author(commit); if (author) { info.author_name = author->name; diff --git a/src/git_repo.h b/src/git_repo.h index f1c5ee3..0b78345 100644 --- a/src/git_repo.h +++ b/src/git_repo.h @@ -28,6 +28,7 @@ struct CommitInfo { std::string oid; std::string short_oid; std::string summary; + std::string body; // message past the summary, "" when there is none std::string author_name; std::string author_email; std::time_t time = 0; diff --git a/static/style.css b/static/style.css index af201b1..ccc59ab 100644 --- a/static/style.css +++ b/static/style.css @@ -38,6 +38,7 @@ h1 { font-size: 1.4rem; word-break: break-all; } .meta, .actions, .tags { color: var(--muted); font-size: 0.9rem; } .actions a { font-size: 0.9rem; } .tags a { display: inline-block; padding: 0 0.4rem; border: 1px solid var(--muted); border-radius: 3px; } +.commit-notice { color: var(--muted); font-size: 0.9rem; font-family: monospace; } .repo-list { list-style: none; padding: 0; } .repo-list li { padding: 0.4rem 0; border-bottom: 1px solid var(--border); } @@ -46,6 +47,8 @@ table { width: 100%; border-collapse: collapse; } table.tree td, table.log td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border); } table.tree .size, table.log .date, table.log .author { color: var(--muted); white-space: nowrap; } table.tree .size { text-align: right; } +.commit-more summary { color: var(--muted); font-size: 0.85rem; cursor: pointer; } +.commit-body { margin: 0.5rem 0 0; white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; } .dir { font-weight: 600; } .submodule { color: var(--muted); } diff --git a/templates/skin.tmpl b/templates/skin.tmpl index e4eb4d1..e21a321 100644 --- a/templates/skin.tmpl +++ b/templates/skin.tmpl @@ -78,6 +78,9 @@ <% view tree_view uses content::tree_view extends master %> <% template content_body() %>

<%= repo %><% if (content.path.length() > 0) %>/<%= path %><% end %>

+<% if (content.query.length() > 0) %> +

browsing at commit = <%= commit_oid %>

+<% end %> <% if (not content.on_default_branch) %> <% if (content.branches.size() > 0) %>

branches: <% foreach b in branches %><% item %><%= b.name %> <% end item %><% end foreach %>

@@ -117,6 +120,9 @@ <% view file_view uses content::file_view extends master %> <% template content_body() %>

<%= path %>

+<% if (content.query.length() > 0) %> +

browsing at commit = <%= commit_oid %>

+<% end %> <% if (not content.on_default_branch) %> <% if (content.branches.size() > 0) %>

branches: <% foreach b in branches %><% item %><%= b.name %> <% end item %><% end foreach %>

@@ -180,7 +186,11 @@ <% foreach c in commits %><% item %> <%= c.short_oid %> -<%= c.summary %> +<%= c.summary %> +<% if (c.body.length() > 0) %> +
expand
<%= c.body %>
+<% end %> + <%= c.author_name %> <% c++ out() << util::format_time(c.time); %>