mygit

[UNMAINTAINED] A cgit/webgit alternative, written in Rust
Log | Files | Refs | README | LICENSE

commit 22433cfc94b7294a4f71be2ca79e2169610b5b5a
parent bbd8d86252c3a267ea243204aae8c2a415a9e525
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Tue, 16 Mar 2021 22:56:21 -0700

Add email fallback if author not present in git log

Diffstat:
Msrc/main.rs | 4++--
Mtemplates/log.html | 2+-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main.rs b/src/main.rs @@ -390,8 +390,8 @@ async fn main() -> Result<(), std::io::Error> { app.at("/:repo_name/log/:ref").get(repo_log); // ref optional app.at("/:repo_name/tree").get(repo_tree); app.at("/:repo_name/tree/:ref").get(repo_tree); - // app.at("/:repo_name/tree/:ref/item/:file").get(repo_log); ref = master/main when not present - // Bonus: raw files, patchsets + // app.at("/:repo_name/tree/:ref/item/:file").get(repo_file); + // Raw files, patch files app.listen("127.0.0.1:8081").await?; Ok(()) } diff --git a/templates/log.html b/templates/log.html @@ -9,7 +9,7 @@ <td class="commit-hash"><a href="/{{repo|repo_name|urlencode_strict}}/commit/{{commit.id()}}">{{commit.id().to_string()[..7]}}</a></td> {% let summary = commit.summary().unwrap_or("")|truncate(72) %} <td class="commit-summary">{{summary}}</td> - <td class="commit-author-email"><a href="mailto:{{commit.author().email().unwrap_or("")}}">{{commit.author().name().unwrap_or("")}}</a></td> + <td class="commit-author-email"><a href="mailto:{{commit.author().email().unwrap_or("")}}">{{commit.author().name().unwrap_or(commit.author().email().unwrap_or(""))}}</a></td> <td class="commit-date">{{commit.time()|format_datetime("%Y-%m-%d")}}</td> </tr> {% endfor %}