control: wiki list and wiki show !102

merged merged by cmc on 2026-08-28 04:18 UTC · krz/gitbay:wiki-commands into main

Discussion

cmc

The last capability only a browser could reach.

On the companion repo, since it came up: it stays, and it's the right design. Prose inside the code repository would put every doc typo in git log and blame, drag wiki history into every clone, subject a typo fix to protected branches and required reviews, and fire CI. GitHub and GitLab split it for the same reasons.

What was actually wrong is a different decision: the companion has no store row, so resolveRepo can't find it and no command could address it. git push worked because sshd special-cases the .wiki suffix; nothing else did. That's why this adds commands rather than registering the companion as a repository — registering it would make it show up in repo list, explore and search, which it shouldn't.

  • wiki list <owner/name> — page names, and which is the landing page, by the same rule the web used
  • wiki show <owner/name> [<page>] — a page's source, defaulting to the landing page, accepting a name with or without its extension

Access derives from the parent, exactly as git over SSH does: a wiki you can't read belongs to a repository you can't read. Tests cover a stranger being refused a private repo's wiki, a path that tries to climb out, a repo with no wiki, and non-page files excluded from the listing.

Editing remains a push to <repo>.wiki.git — the whole write interface on every surface, so there's nothing for a command to add.

The web dispatches both and keeps only its rendering. TestWikis passes unchanged: same tab, same link rewriting, same 404 parity.

With this merged, no capability is reachable from only one surface.

Closes #48