commit-cloud
Installation
SKILL.md
Draft Sapling stacks backed up from one machine appear on the others after their next scripts/pull, with hashes, dates and branches intact, beside that machine's own stacks and not checked out. Backing up is explicit; restoring happens on pull. Inspired by Meta's commit cloud, which open-source Sapling disables for git repos.
Commands
- Back up:
scripts/commit-cloud backup [<checkout>...]. Backs up every Sapling checkout underprojects/, or those named, and restores what others backed up. Run it when asked to back up a stack, and before a machine is left. There is no per-stack mode: a checkout's draft heads are backed up as a set, which is what lets the set converge. - Restore only:
scripts/commit-cloud restore <checkout>, whichscripts/pullruns for a Sapling checkout before returning to the branch or commit it started on. It also prints apendingline when the checkout's own stacks are not backed up, with the command to run. - Opt in: the first explicit backup clones the repo to
.commit-cloud/. Before that,restoreand the pull hook do nothing. The repo must exist on GitHub, private and never a fork;git config devroot.commitCloudat the root names another asowner/repoor a URL.
Reading the output
Each line is an action on one head, by its 12-character hash: back up, retract, revive, restore … from <host>/<slot> as <branches>, bookmark … as <host>/backup-<date>, hide, keep, pending. Exit 3 means something needs a human, and the message says what: the repo is unreachable, the push was rejected, or a stack's base is on no remote here.
Resuming a restored stack
- It shows in
sl smartlogas ordinary drafts, with the producer's task branch recreated and a bookmark<host>/backup-<yyyymmdd>, dated by the stack's tip commit, with-1,-2for more from the same host and day. - Resume with
git switch <branch>to commit on the task branch, orsl goto <bookmark>orsl goto <hash>. Nothing else changes the working copy. - A restored stack is never backed up again by the machine that restored it. Work committed on top of it is new work, and the next backup carries it.