From eeaba25642392532901cd4c95c23054e9a7ba2b3 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 24 Jun 2026 09:41:43 +0200 Subject: feat: repo list - list all repos, public and private New gitctl repo list / helper list-repos verb. Source of truth is the bare repos on disk (REPO_BASE/*.git), not cgitrc, so private repos (absent from cgitrc since cgit auto-discovery is off) show too. Each repo is tagged PUB/PRIV by cgitrc membership, with its section and a 60-char description from the repo's description file. Client renders an aligned table, green public / dim private on a TTY. Adds repo_sections_from() primitive; find_repo_section becomes a thin lookup over it. Self-tests cover the cgitrc parse and a temp-FS scan. Updates README, SKILL.md, bash completion (repo list action), TODO. Co-Authored-By: Claude Opus 4.8 --- TODO.md | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'TODO.md') diff --git a/TODO.md b/TODO.md index 4c4a26e..6318eae 100644 --- a/TODO.md +++ b/TODO.md @@ -50,18 +50,21 @@ Design notes: stanza push? Or stanza first? Decide and document - partial failure (push fails after the move) should leave a clear, resumable state like create does. -## 2. list repos +## 2. list repos -- DONE -`gitctl repo list` - show repos known to the server, ideally with their section. +`gitctl repo list` is implemented. It lists EVERY bare repo on disk (the full +set, public and private), not just the cgit-exposed ones, because cgit +auto-discovery is off and private repos are not in cgitrc. Source of truth is +`REPO_BASE/*.git`, not cgitrc; cgitrc membership only tags a repo PUB vs PRIV +and supplies its section. Description comes from each repo's `description` file +(truncated 60). Client renders a table, green public / dim private on a TTY. +Helper verb `list-repos`; primitive `list_repos()` + `repo_sections_from()` +(the latter dedupes the old `find_repo_section`). Self-tests cover both the +cgitrc parse and a temp-FS scan. -- New helper verb `list-repos`: parse /etc/cgitrc for `repo.url=` lines and the - preceding `section=` (reuse `find_repo_section` / the section-tracking loop). - Print `
\t` or similar. -- Cheap, read-only, no confirmation. Good first item - unblocks better bash - completion (complete repo names for `desc` / `delete` / `add-remote`) and - gives `delete` something to validate against. -- Alternative source: gitolite (`ssh git_push info` lists repos) but cgitrc is - the helper's own domain and already parsed; prefer it. +Still open from the original plan: extend bash completion to complete repo +NAMES (for `desc` / `delete` / `add-remote`) now that a list verb exists. The +`repo list` action itself is already in completion. ## 3. `-y` / `--yes` flag on `repo create` -- cgit v1.2.3