Files
devvm/testdata/script
w3cjandClaude Opus 5.5 bdd781c037 feat(clone): --clone gives the VM its own clone
devvm --clone makes a VM that mounts nothing of the folder's: only the
shared tools and its agents' config folders. Once it runs, devvm makes a
repo at the folder's path in the VM (receive.denyCurrentBranch
updateInstead, HEAD on the host's branch), pushes every local branch
into it with host git over devvm's own ssh config (pinned host keys),
and adds a remote to the host repo (devvm, else devvm-<folder>, else the
VM's name), URL <vm>:<dir>. It offers the ~/.ssh/config Include line
(EnsureInclude's first caller), else says how to fetch until then, warns
about uncommitted changes, which aren't copied, and opens the shell in
the clone. No .git protection, set-id check or ssh remote hint for clone
VMs. A copy that fails is retried on the next launch. --clone on a VM
that mounts its folder is refused.

rm on a clone VM (not -f) starts it if stopped, lists branches whose
commits the host repo lacks (VM answers looked up only when they're
object names) and offers to fetch them into <remote>/*, then shows the
clone's uncommitted changes and asks before deleting; without a
terminal either refuses and keeps the VM. Deleting removes the remote's
config if it still points at the VM, keeping fetched branches.

Inventory:
- vm: clone.go (isClone, checkCloneRepo, seedClone, freeRemote,
  remoteURL, cloneRmCheck, cloneGit, unfetchedRefs, removeRemote,
  gitSSH, hostGit, capped); state keys mode, clone_remote, seeded;
  Options.Clone; create skips the unsafe-folder check, the mount, .git
  protection; setUp seeds unseeded clone VMs; open refuses
  clone_needs_new_vm and skips Check/setid for clones; ensureRunning
  (from export); Rm runs the clone check; delete removes the remote; the
  interrupt cleanup removes it too
- cli: --clone on up; rm and root Long, rm -f's help
- messages: clone_needs_git, clone_not_top, clone_no_commits,
  clone_detached, clone_needs_new_vm, copying_branches,
  clone_seed_failed, remotes_taken, remote_add_failed, fetch_until,
  uncommitted_not_copied, clone_ready, unfetched_commits,
  no_terminal_fetch, fetch_before_delete, fetching, fetch_failed,
  clone_check_failed, clone_dirty, no_terminal_delete, delete_anyway,
  kept, removed_remote; unsafe_folder and git_protect_needs_macos_new
  name --clone. Doc links: clone_not_top, clone_no_commits,
  clone_detached, clone_needs_new_vm, remotes_taken, fetch_until,
  no_terminal_fetch, no_terminal_delete
- tests: testscript clone.txtar (refusals, the new VM's mounts, state,
  push, remote and clone; no reseed; rm clean, unfetched, dirty, -f, a
  remote pointed elsewhere; a failed copy retried; clone_needs_new_vm);
  Go TestUpClone, TestCloneRm (fetch yes/no, delete anyway, a stopped VM
  started, VM answers that aren't object names), TestCheckCloneRepo,
  TestFreeRemote, TestRemoveRemote. Stubs: limactl runs a clone's git
  on $STUB_DIR/vmfs; new ssh stub pushes and fetches there
- converted: the bats suite has no clone cases besides cli.bats
  parse_args, which waits for --from
- e2e: clone section (own HOME and git config, throwaway repo): clone
  with every branch and only the tools mounted, shell in it, remote,
  nothing locked, rm refusing unfetched commits and uncommitted
  changes, fetch over devvm's ssh config, rm -f removing the remote and
  keeping fetched branches
- docs: clone.md; commands, security, git-protection, ssh,
  contributing, index; CLI reference

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 12:26:40 -06:00
..
2026-10-24 09:50:15 -06:00
2026-10-24 03:11:14 -06:00
2026-10-24 09:50:15 -06:00