4 files changed,
37 insertions(+),
34 deletions(-)
Author:
Oleksandr Smirnov
olexsmir@gmail.com
Committed at:
2026-01-28 18:40:04 +0200
Change ID:
yposxkvklnuolmpnutxwtpwlszokzmxm
Parent:
1731de8
M
internal/git/repo.go
@@ -6,6 +6,7 @@ "fmt"
"os" "path/filepath" "sort" + "strings" "time" "github.com/go-git/go-git/v5"@@ -149,6 +150,8 @@ })
return branches, err } +const defaultDescription = "Unnamed repository; edit this file 'description' to name the repository" + func (g *Repo) Description() (string, error) { // TODO: ??? Support both mugit.description and /description file path := filepath.Join(g.path, "description")@@ -161,7 +164,12 @@ if err != nil {
return "", fmt.Errorf("failed to read description: %w", err) } - return string(d), nil + desc := string(d) + if strings.Contains(desc, defaultDescription) { + return "", nil + } + + return desc, nil } func (g *Repo) IsPrivate() (bool, error) {
M
web/static/style.css
@@ -95,6 +95,10 @@ .repo-breadcrumb {
color: var(--gray); } +.repo-breadcrumb:before { + content: "<"; /* TODO: add an arrow */ +} + .repo-breadcrumb a { color: var(--gray); }@@ -155,7 +159,9 @@ }
.index .url { white-space: nowrap; } .index .desc { width: 100%; } +.index .desc .unset { color: var(--gray); } .index .idle { white-space: nowrap; } + .index tbody tr.nohover:hover { background: transparent;@@ -404,30 +410,25 @@ .commit {
margin-bottom: 1rem; } - .commit pre { - padding-bottom: 0; - white-space: pre-wrap; - } - - .commit-message { - margin-top: 0.25rem; - font-size: 1rem; - line-height: 1.35; - margin-bottom: 0; - } - - - .commit .box { - margin-bottom: 0.25rem; - } - - - .commit .commit-info { - padding-bottom: 0.25rem; - } +.commit pre { + padding-bottom: 0; + white-space: pre-wrap; +} +.commit-message { + margin-top: 0.25rem; + font-size: 1rem; + line-height: 1.35; + margin-bottom: 0; +} +.commit .box { + margin-bottom: 0.25rem; +} +.commit .commit-info { + padding-bottom: 0.25rem; +} .diff-add { color: green;@@ -443,7 +444,7 @@ }
.ref { font-family: var(--sans-font); - font-size: 14px; + font-size: 1rem; color: var(--gray); display: inline-block; padding-top: 0.7em;@@ -478,13 +479,6 @@ grid-template-columns: 1rem minmax(0, 1fr);
gap: 1rem; padding: 0.5rem; background: var(--light-gray); - overflow-x: auto; -} - -.chroma-file-wrapper { - display: flex; - flex-direction: row; - grid-template-columns: 1rem minmax(0, 1fr); overflow-x: auto; }
M
web/templates/_repo_header.html
@@ -2,12 +2,13 @@ {{ define "repo_header" }}
<header class="repo-header"> <div class="repo-breadcrumb"> <a href="/">all repos</a> + </div> + <h1 class="repo-name"> + {{ .name }} {{- if .ref }} <span class="ref">@ {{ .ref }}</span> {{- end }} - </div> - - <h1 class="repo-name">{{ .name }}</h1> + </h1> {{- if .desc }} <div class="desc">{{ .desc }}</div> {{- end }}
M
web/templates/index.html
@@ -23,7 +23,7 @@ <tbody>
{{ range .repos }} <tr> <td class="url"><a href="/{{ .Name }}">{{ .Name }}</a></td> - <td class="desc">{{ .Desc }}</td> + <td class="desc">{{- if .Desc }}{{ .Desc }}{{- else }}<span class="unset">No description set</span>{{- end }} <td class="idle">{{ humanizeTime .LastCommit }}</td> </tr> {{ end}}