Add commits page with graph, diff, file browser, and checkout

New features:
- Commits list with ASCII graph, hash, message, author, date
- Single commit diff view with per-file diffs
- File tree browser at any commit
- File content viewer at any commit
- Checkout entire commit (detached HEAD)
- Checkout selected files from a commit

New GitService methods: listCommits, getCommitDiff,
listFilesAtCommit, getFileContentAtCommit, checkoutCommit,
checkoutFilesFromCommit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-27 09:44:38 +01:00
parent 383864469d
commit fdc520cfaf
12 changed files with 634 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title th:text="'Browse - ' + ${shortHash}">Browse</title>
</head>
<body>
<h2>Browse <span th:text="${shortHash}"></span></h2>
<p><a th:href="@{/repo/{name}/commits(name=${name})}">&lt; Back to commits</a></p>
<p th:if="${!path.isEmpty()}">
Path: <b th:text="${path}"></b>
<br>
<a th:href="@{/repo/{name}/tree/{hash}(name=${name}, hash=${hash}, path=${path.contains('/') ? path.substring(0, path.lastIndexOf('/')) : ''})}">&lt; Parent directory</a>
</p>
<table border="1" cellpadding="4" cellspacing="0">
<tr>
<th>Type</th>
<th>Name</th>
</tr>
<tr th:each="f : ${files}">
<td th:text="${f.type}"></td>
<td>
<a th:if="${f.type == 'tree'}" th:href="@{/repo/{name}/tree/{hash}(name=${name}, hash=${hash}, path=${f.path})}" th:text="${f.path.contains('/') ? f.path.substring(f.path.lastIndexOf('/') + 1) : f.path}"></a>
<a th:if="${f.type == 'blob'}" th:href="@{'/repo/' + ${name} + '/blob/' + ${hash} + '/' + ${f.path}}" th:text="${f.path.contains('/') ? f.path.substring(f.path.lastIndexOf('/') + 1) : f.path}"></a>
</td>
</tr>
</table>
<p th:if="${files.isEmpty()}">Empty directory.</p>
</body>
</html>