feat(repo-sync): one local tree for every repo reachable on your forges

bin/repo-sync ports the Alphalink dotfiles repo/repo-reset zsh functions to
bash + zsh on Linux and macOS, for several forges at once: GitLab, GitHub
(+GHES), Gitea/Forgejo, Bitbucket Cloud, via curl + jq (no per-forge CLI).
Tokens live in ~/.config/repos/forges.conf (0600, parsed line by line, never
tracked), written by `repo-sync add`. Cache ~/.cache/repos/list refreshed
at most once a day (mkdir lock: flock is not on macOS), same namespace/project
on two forges kept once, archived and mirrors skipped. Layout
~/repos/<namespace with / as @>/<project>.

rc files: `repo <project> [namespace]` clones on demand and cd's, with
completion (bash compgen, zsh _describe), background refresh at shell start.
install.sh: jq in the apt and brew lists, chmod repo-sync.

Verified: shellcheck + bash -n, zsh -n; stub-curl harness over the four forges
(pagination, dedup, auth headers, lock, stale cache, path/clone); live GitLab
refresh (139 projects, 3s).
This commit is contained in:
bchanot
2026-10-07 15:31:03 +02:00
parent 2573756e73
commit f42e28807b
9 changed files with 451 additions and 4 deletions
+12
View File
@@ -123,3 +123,15 @@ Branch: feature/identity-prompt (off develop). Values were visible to anyone rea
- [x] vim/vimrc: g:_author / g:_email from $USER / $EMAIL
- [x] README, CLAUDE.md (CHANGELOG left to the release step, like the tmux work)
- [x] Verify: shellcheck, bash -n, zsh -n; temp-HOME render (env preset, existing rc reuse); vim reads the env
## Feature — repo-sync: one local tree for every reachable git repo, multi-forge (2026-10-07)
Branch: feature/repo-sync (off develop). Design approved in chat: name `repo-sync`, tokens in
`~/.config/repos/forges.conf` 0600 (never tracked), root `~/repos`, Bitbucket Cloud only.
Port of the Alphalink dotfiles `repo` / `repo-reset` zsh functions, bash + zsh, Linux + macOS.
- [x] bin/repo-sync — add / refresh (daily, mkdir lock) / list / tree / path / clone; curl + jq
fetchers for gitlab, github (+GHES), gitea/forgejo, bitbucket cloud; dedup namespace/project
- [x] bash/bashrc-linux, bash/bashrc-osx, zsh/zshrc-osx — `repo` function (cd), completion, background refresh
- [x] install.sh — jq in apt + brew lists, chmod repo-sync
- [x] README.md (table + CLI section) + CLAUDE.md layout
- [x] shellcheck + bash -n; stub-curl harness per forge (fixtures), live GitLab run
- [ ] commit on feature branch; registries. No finish without explicit signal.