+{{ end }}
+
+{{ define "attribution" }}
+ {{ $commit := index . 0 }}
+ {{ $map := index . 1 }}
+
{{ end }}
{{ define "branchList" }}
diff --git a/appview/pages/templates/repo/log.html b/appview/pages/templates/repo/log.html
--- a/appview/pages/templates/repo/log.html
+++ b/appview/pages/templates/repo/log.html
@@ -17,22 +17,16 @@
{{ $grid := "grid grid-cols-14 gap-4" }}
-
Author
+
Author
Commit
Message
-
Date
{{ range $index, $commit := .Commits }}
{{ $messageParts := splitN $commit.Message "\n\n" 2 }}
-
- {{ $did := index $.EmailToDid $commit.Author.Email }}
- {{ if $did }}
- {{ template "user/fragments/picHandleLink" $did }}
- {{ else }}
-
{{ $commit.Author.Name }}
- {{ end }}
+
+ {{ template "attribution" (list $commit $.EmailToDid) }}
{{ $verified := $.VerifiedCommits.IsVerified $commit.Hash.String }}
@@ -61,6 +55,7 @@
{{ index $messageParts 0 }}
+
{{ if gt (len $messageParts) 1 }}
{{ end }}
@@ -72,18 +67,19 @@ {{ $tag }}
{{ end }}
{{ end }}
+
+
+
+ {{ $pipeline := index $.Pipelines .Hash.String }}
+ {{ if and $pipeline (gt (len $pipeline.Statuses) 0) }}
+ {{ template "repo/pipelines/fragments/pipelineSymbolLong" (dict "Pipeline" $pipeline "RepoInfo" $.RepoInfo) }}
+ {{ end }}
+
{{ if gt (len $messageParts) 1 }}
{{ nl2br (index $messageParts 1) }}
{{ end }}
-
-
-
- {{ $pipeline := index $.Pipelines .Hash.String }}
- {{ if and $pipeline (gt (len $pipeline.Statuses) 0) }}
- {{ template "repo/pipelines/fragments/pipelineSymbolLong" (dict "Pipeline" $pipeline "RepoInfo" $.RepoInfo) }}
- {{ end }}
{{ template "repo/fragments/shortTimeAgo" $commit.Committer.When }}
@@ -152,13 +148,7 @@ {{ end }}
-
- {{ $did := index $.EmailToDid $commit.Author.Email }}
-
- {{ if $did }}{{ template "user/fragments/picHandleLink" $did }}{{ else }}{{ $commit.Author.Name }}{{ end }}
-
-
+ {{ template "attribution" (list $commit $.EmailToDid) }}
{{ template "repo/fragments/shortTime" $commit.Committer.When }}
@@ -176,6 +166,33 @@ {{ end }}
+{{ end }}
+
+{{ define "attribution" }}
+ {{ $commit := index . 0 }}
+ {{ $map := index . 1 }}
+
+ {{ $author := index $map $commit.Author.Email }}
+ {{ $coauthors := $commit.CoAuthors }}
+ {{ $all := list }}
+
+ {{ if $author }}
+ {{ $all = append $all $author }}
+ {{ end }}
+ {{ range $coauthors }}
+ {{ $co := index $map .Email }}
+ {{ if $co }}
+ {{ $all = append $all $co }}
+ {{ end }}
+ {{ end }}
+
+ {{ template "fragments/tinyAvatarList" (dict "all" $all "classes" "size-6") }}
+
+ {{ if $author }}{{ resolve $author }}{{ else }}{{ $commit.Author.Name }}{{ end }}
+ {{ if $coauthors }} +{{ length $coauthors }}{{ end }}
+
+
{{ end }}
{{ define "repoAfter" }}
diff --git a/appview/repo/repo_util.go b/appview/repo/repo_util.go
--- a/appview/repo/repo_util.go
+++ b/appview/repo/repo_util.go
@@ -1,6 +1,7 @@
package repo
import (
+ "maps"
"slices"
"sort"
"strings"
@@ -43,18 +44,17 @@
func uniqueEmails(commits []types.Commit) []string {
emails := make(map[string]struct{})
for _, commit := range commits {
- if commit.Author.Email != "" {
- emails[commit.Author.Email] = struct{}{}
- }
- if commit.Committer.Email != "" {
- emails[commit.Committer.Email] = struct{}{}
+ emails[commit.Author.Email] = struct{}{}
+ emails[commit.Committer.Email] = struct{}{}
+ for _, c := range commit.CoAuthors() {
+ emails[c.Email] = struct{}{}
}
}
- var uniqueEmails []string
- for email := range emails {
- uniqueEmails = append(uniqueEmails, email)
- }
- return uniqueEmails
+
+ // delete empty emails if any, from the set
+ delete(emails, "")
+
+ return slices.Collect(maps.Keys(emails))
}
func balanceIndexItems(commitCount, branchCount, tagCount, fileCount int) (commitsTrunc int, branchesTrunc int, tagsTrunc int) {
diff --git a/types/commit.go b/types/commit.go
--- a/types/commit.go
+++ b/types/commit.go
@@ -172,7 +172,7 @@ var (
coAuthorRegex = regexp.MustCompile(`(?im)^Co-authored-by:\s*(.+?)\s*<([^>]+)>`)
)
-func (commit *Commit) CoAuthors() []object.Signature {
+func (commit Commit) CoAuthors() []object.Signature {
var coAuthors []object.Signature
matches := coAuthorRegex.FindAllStringSubmatch(commit.Message, -1)