feat: in-app git sync (s keybind) #17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/git-sync"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Brings the graph's git sync in-house. Previously sync lived in an external fish function (
weft-sync.fish); now it's a first-class, observable action inside the TUI — weft's second deliberate disk-mutating surface alongsideinternal/edit/.What it does
Press
s(page view) to run commit → pull --rebase → push on the--graphrepo, asynchronously:⟳ syncing…→✓ synced, or✗ <stage> failed — see weft.logon failure.weft.logand you resolve in a shell.smid-sync is a no-op.Design highlights
internal/sync/package shells out to systemgit(no go-git). Returns aResult{Committed, Pulled, Pushed, Stage, Output, Err}.sis reachable — sync just operates on the working tree.Appso view tests stub it (never shell out to git); sync-package tests use throwaway repos with a local bare remote (no network, never touches the real graph).Provenance
docs/superpowers/specs/2026-06-17-git-sync-design.mddocs/superpowers/plans/2026-06-17-git-sync.mdResultbug (Committed/Pulled were dropped on mid-sequence failure paths).go vet ./... && go test ./...green (7 packages).The fail() helper returned a fresh Result{}, dropping Committed/Pulled on the add/commit/pull failure paths — so a pull conflict after a successful local commit reported Committed:false. Replace it with a failWith closure that carries the running res forward, matching the push-failure path. Add assertions locking both invariants: commit survives a failed pull; a clean no-advance sync does not report Pulled.