vole
Clone
Read only, no credentials:
https://rodent.software/vole.git
Write over SSH with a registered key:
git clone ssh://git@rodent.software:2222/vole.git
A free and open-source forge that lives in your Git repo.
Show real accounts as repository contributors
a32a859a08276681497be390d6f7195098a97ab4 · Keenan Nemetz · 5d ago · parent 802e0e52
Show real accounts as repository contributors Count contributors from the change and issue records instead of the author text in commits: changes merged, issues those changes fixed, issues the reporter opened that were fixed, and reviews that named the merged head. The overview lists accounts by that work with compact icon counts and full labels in tooltips. The shortlog-derived contributor table and its refresh path are gone.
forge/index/overview.go +4−33
| @@ -1,11 +1,11 @@ | |||
| 1 | 1 | package index | |
| 2 | 2 | ||
| 3 | 3 | // The overview's stored summaries: the default branch's recent commits, the | |
| 4 | // languages it is mostly made of, its authors, and the repository's tags. | ||
| 4 | // languages it is mostly made of, and the repository's tags. | ||
| 5 | 5 | // | |
| 6 | // All four change when a ref moves, so they are written then (see RefreshHead, | ||
| 7 | // RefreshContributors and RefreshTags) and read as rows. A repository page then | ||
| 8 | // has no reason to walk the tree or the history. | ||
| 6 | // All three change when a ref moves, so they are written then (see RefreshHead | ||
| 7 | // and RefreshTags) and read as rows. A repository page then has no reason to | ||
| 8 | // walk the tree or the history. | ||
| 9 | 9 | ||
| 10 | 10 | import "github.com/rodent-software/vole/internal/lang" | |
| 11 | 11 | ||
| @@ -16,11 +16,6 @@ type CommitRow struct { | |||
| 16 | 16 | When int64 | |
| 17 | 17 | } | |
| 18 | 18 | ||
| 19 | type ContributorRow struct { | ||
| 20 | Name string | ||
| 21 | Commits int | ||
| 22 | } | ||
| 23 | |||
| 24 | 19 | // TagRow is one entry of refs/tags, peeled to the commit it names. | |
| 25 | 20 | type TagRow struct { | |
| 26 | 21 | Name string | |
| @@ -76,30 +71,6 @@ func (s *Store) Languages(repoID string) ([]lang.Share, error) { | |||
| 76 | 71 | return out, rows.Err() | |
| 77 | 72 | } | |
| 78 | 73 | ||
| 79 | // Contributors returns the authors of the default branch, most commits first. | ||
| 80 | func (s *Store) Contributors(repoID string, n int) ([]ContributorRow, error) { | ||
| 81 | q := `SELECT name, commits FROM repo_contributors WHERE repo_id=? ORDER BY pos` | ||
| 82 | args := []any{repoID} | ||
| 83 | if n > 0 { | ||
| 84 | q += ` LIMIT ?` | ||
| 85 | args = append(args, n) | ||
| 86 | } | ||
| 87 | rows, err := s.db.Query(q, args...) | ||
| 88 | if err != nil { | ||
| 89 | return nil, err | ||
| 90 | } | ||
| 91 | defer rows.Close() | ||
| 92 | var out []ContributorRow | ||
| 93 | for rows.Next() { | ||
| 94 | var c ContributorRow | ||
| 95 | if err := rows.Scan(&c.Name, &c.Commits); err != nil { | ||
| 96 | return nil, err | ||
| 97 | } | ||
| 98 | out = append(out, c) | ||
| 99 | } | ||
| 100 | return out, rows.Err() | ||
| 101 | } | ||
| 102 | |||
| 103 | 74 | // Tags returns the repository's tags, newest first, which is the order the | |
| 104 | 75 | // releases section shows. | |
| 105 | 76 | func (s *Store) Tags(repoID string, n int) ([]TagRow, error) { | |