Repository navigation
feat(cli): import exact local Git revisions into sandboxes - #41
Conversation
farhan-helmy
left a comment
There was a problem hiding this comment.
Thanks, this is careful work:
--end-of-optionsguards the revision.- Git is found only in absolute PATH directories.
- Git in the VM runs with a clean environment.
- The pack passes a SHA-256 check before
index-pack, and a connectivity check before checkout. - Nothing is deleted recursively when the rename is uncertain.
The tests run the real restore script against Git, and the API's file rename and mkdir support what it needs. CI passes.
Before merge: please rebase for the CHANGELOG.md and package.json conflicts. 0.17.0 assumes #38 and #40 land first.
Bring in 0.14.3. The 0.17.0 changelog entry sits above it and the package keeps 0.17.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
farhan-helmy
left a comment
There was a problem hiding this comment.
I merged main into this branch to bring in 0.14.3 (no force push). The only conflicts were in CHANGELOG.md and package.json. Your 0.17.0 entry now sits above 0.14.3, and the package keeps 0.17.0. The rest of the diff is unchanged, and CI passes, including the Windows job from #37. Re-approving, since the push dismissed my earlier review.
No action needed from you. I'll update the changelog again as the earlier PRs land.
Bring in 0.14.4, 0.15.0 and 0.16.0. The 0.17.0 changelog entry sits above them and the package keeps 0.17.0. The README keeps both new sections: the 0.16.0 operation guide, then Git import. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What and why
Local commits can be ready to test before they are pushed.
bxc sandbox import-git SANDBOX_ID . HEAD /workspace/projecttakes the selected commit and its reachable history from a local checkout, including repositories without a remote.The command uploads a Git pack in 8 MiB chunks using the existing sandbox API. It verifies the pack and the checked-out commit, then moves the detached checkout into place with overwrite disabled. Working-tree changes, Git configuration, credential helpers, and remotes stay local.
How it was tested
npm pack --dry-run, and installed CLI smoke tests on Node 20, 22, and 24 passed.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.