2 files changed,
20 insertions(+),
4 deletions(-)
Author:
Oleksandr Smirnov
olexsmir@gmail.com
Committed at:
2026-02-10 17:45:05 +0200
Authored at:
2026-02-10 00:08:43 +0200
Change ID:
zoyukrqomkvkrkmlozmqrmuwnrokmovx
Parent:
155aa35
jump to
| M | internal/git/repo.go |
| M | web/templates/repo_commit.html |
M
internal/git/repo.go
路路路 72 72 73 73 type Commit struct { 74 74 Message string 75 + AuthorEmail string 76 + AuthorName string 77 + ChangeID string 78 + Committed time.Time 75 79 Hash string 76 80 HashShort string 77 - AuthorName string 78 - AuthorEmail string 79 - Committed time.Time 80 81 } 81 82 82 83 func newShortHash(h plumbing.Hash) string { return h.String()[:7] } 83 84 func newCommit(c *object.Commit) *Commit { 85 + var changeID string 86 + for _, header := range c.ExtraHeaders { 87 + if header.Key == "change-id" { 88 + changeID = header.Value 89 + break 90 + } 91 + } 92 + 84 93 return &Commit{ 94 + Message: c.Message, 85 95 AuthorEmail: c.Author.Email, 86 96 AuthorName: c.Author.Name, 97 + ChangeID: changeID, 87 98 Committed: c.Committer.When, 88 99 Hash: c.Hash.String(), 89 100 HashShort: newShortHash(c.Hash), 90 - Message: c.Message, 91 101 } 92 102 } 93 103
M
web/templates/repo_commit.html
路路路 25 25 <strong>Committed at:</strong> 26 26 {{ .commit.Committed }} 27 27 </div> 28 + {{ if .commit.ChangeID -}} 29 + <div> 30 + <strong>Change ID:</strong> 31 + {{ .commit.ChangeID }} 32 + </div> 33 + {{- end }} 28 34 <div> 29 35 <strong>Parent:</strong> 30 36 {{ range $i, $p := .parents -}}