Lay overview out as a table

The status field was not a column: "*", "↑2", "✓" and "✓ (no upstream)"
are four different widths, so everything after them started somewhere
else on every line and the eye had to hunt along each row instead of
going down one.

Each field now has its own measured column: name (with the branch
appended when it is not master/main), a one-character dirty marker, the
sync state, host and age, then the mirrors. "(no upstream)" was fifteen
columns wide for something that is not even a problem, and is now "–".
Colour weights the row rather than decorating it -- a project that is
clean and in sync goes grey, the arrows and the dirty marker keep their
colour -- and the rows needing action sort to the top, alphabetically
within each group so positions stay predictable.

padRight counted bytes, which was fine while everything it padded was
ASCII; the arrows and check marks are three bytes and one column, so it
counts runes now.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-26 17:42:37 +02:00
co-authored by Claude Opus 5
parent 86fb898df4
commit cb1ff98c3d
6 changed files with 194 additions and 67 deletions
+3 -3
View File
@@ -88,7 +88,7 @@ func TestReportInventoryUnreachableServer(t *testing.T) {
out := captureStdout(t, func() {
reportInventory([]string{"a", "b"}, nil, errors.New("network is unreachable"))
})
if strings.Contains(out, "not on the git server") {
if strings.Contains(out, "not on the server") {
t.Errorf("an unreachable server was reported as missing repositories: %q", out)
}
if !strings.Contains(out, "not reachable") {
@@ -101,10 +101,10 @@ func TestReportInventorySplitsSides(t *testing.T) {
out := captureStdout(t, func() {
reportInventory([]string{"both", "onlyhere"}, []string{"both", "onlythere"}, nil)
})
if !strings.Contains(out, "not on the git server:") || !strings.Contains(out, "onlyhere") {
if !strings.Contains(out, "not on the server (init)") || !strings.Contains(out, "onlyhere") {
t.Errorf("local-only project not reported: %q", out)
}
if !strings.Contains(out, "not cloned here:") || !strings.Contains(out, "onlythere") {
if !strings.Contains(out, "not cloned here (clone)") || !strings.Contains(out, "onlythere") {
t.Errorf("server-only project not reported: %q", out)
}
if strings.Contains(out, "both") {