- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
<!--
Copyright 2025 Shota FUJI <pockawoooh@gmail.com>
SPDX-License-Identifier: MIT
-->
{{ define "repo-commit" -}}
<!DOCTYPE html>
<html lang="en">
{{ $shorthash := slice .Commit.Hash.String 0 8 }}
<head>
{{ template "head" }}
<title>
{{ $shorthash }} - {{ .Meta.DisplayName }}
</title>
<meta name="description" content='{{ $shorthash }} in {{ .Meta.DisplayName }}' />
</head>
<body>
<header class="header">
<ol class="breadcrumbs">
<li>
<a href="/">Top</a>
</li>
<li>
<a href="/{{ .Meta.DisplayName }}">{{ .Meta.DisplayName }}</a>
</li>
<li>
<a href="/{{ .Meta.DisplayName }}/commit/{{ .Meta.Ref }}" aria-current="page">
{{- $shorthash -}}
</a>
</li>
</ol>
{{ template "repo-header" . }}
{{ template "repo-nav" . }}
</header>
<main class="passthru">
<div class="main">
<h1>{{ $shorthash }}</h1>
<pre>
{{- .Commit.Message -}}
</pre>
<h2>Changes</h2>
<p>
{{ .Diff.Stat.FilesChanged }} changed files
(+{{ .Diff.Stat.Insertions }}/-{{ .Diff.Stat.Deletions }})
</p>
<ul>
{{ $meta := .Meta }}
{{ $root := . }}
{{- range .Diff.Files }}
<li>
<div>
{{- if or .IsRename .IsDelete }}
<a href="/{{ $meta.DisplayName }}/blob/{{ $root.Parent.Hash.String }}/{{ .OldName }}">{{ .OldName }}</a>
{{- if .IsRename }}
>
{{- else }}
(deleted)
{{- end }}
{{- end}}
<a href="/{{ $meta.DisplayName }}/blob/{{ $root.Commit.Hash.String }}/{{ .NewName }}">{{ .NewName }}</a>
{{- if not .OldName }}
<span>(new)</span>
{{ end -}}
</div>
<div>
{{ if .IsBinary -}}
<p>Diff for binary file is unavailable.</p>
{{- else -}}
<ul>
{{- range .TextFragments }}
<li>
<span>{{ .Header }}</span>
<pre>
{{- range .Lines -}}
{{- $op := "" -}}
{{- if eq .Op.String "+" -}}
{{- $op = "add" -}}
{{- else if eq .Op.String "-" -}}
{{- $op = "delete" -}}
{{- end -}}
<span data-op="{{ $op }}">{{ .String }}</span>
{{- end -}}
</pre>
</li>
{{ end -}}
</ul>
{{- end }}
</div>
</li>
{{ end -}}
</ul>
</div>
<div class="aside">
<h2>Metadata</h2>
<dl>
<dt>Author</dt>
<dd>
<a href="mailto:{{ .Commit.Author.Email }}">
{{- .Commit.Author.Name -}}
</a>
authored at
<time datetime='{{ .Commit.Author.When.Format "2006-01-02T15:04:05-0700" }}'>
{{ .Commit.Author.When.Format "2006-01-02 15:04:05 -0700" }}
</time>
</dd>
<dt>Committer</dt>
<dd>
<a href="mailto:{{ .Commit.Committer.Email }}">
{{- .Commit.Committer.Name -}}
</a>
commited at
<time datetime='{{ .Commit.Committer.When.Format "2006-01-02T15:04:05-0700" }}'>
{{ .Commit.Committer.When.Format "2006-01-02 15:04:05 -0700" }}
</time>
</dd>
{{- if .Commit.PGPSignature }}
<dt>Signature</dt>
<dd>
<details>
<summary>View</summary>
<pre><code>{{ .Commit.PGPSignature }}</code></pre>
</details>
</dd>
{{ end -}}
{{- if not .Parent.Hash.IsZero }}
<dt>Parent</dt>
<dd>
<a href="/{{ .Meta.DisplayName }}/commit/{{ .Parent.Hash.String }}">
{{- slice .Parent.Hash.String 0 8 -}}
</a>
</dd>
{{ end -}}
</dl>
</div>
</main>
</body>
</html>
{{- end }}