Skip to content

One fork command for task copies, from a clone or a mount - #154

Merged
lydakis merged 2 commits into
mainfrom
claude/project-thread-850pry
Oct 26, 2026
Merged

lydakis merged 2 commits into
mainfrom
claude/project-thread-850pry

Conversation

@lydakis

@lydakis lydakis commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Requested by George · project thread

Making a throwaway copy for one task took a different command depending on where you started: sandfs fork in a folder sandfs mounts, sandfs mount git:. DIR --uncommitted --branch x in a clone (#152). Now fork does both, and the mount flags are gone, so mount is the live view again and fork is the one way to make a copy:

cd ~/proj                                  # a clone, or a folder sandfs mounts
sandfs fork . ~/tasks/fix-login --branch fix-login
cd ~/tasks/fix-login                       # ...work and commit...
git push origin fix-login
sandfs rm --unmount fix-login

Changes (CLI only, no core API change)

  • fork FROM now accepts, besides a workspace name or its mount directory:
    • any folder inside a mount, which forks that workspace (so sandfs fork . works from a subfolder);
    • a folder of a git repository sandfs doesn't mount, such as a clone: a git: workspace at HEAD plus the folder's uncommitted, new and deleted files, through Task copies of a local repository: mount --branch, --uncommitted, rm --unmount #152's git::start (now always copying those files);
    • a plain folder outside any repository is refused for now with a pointer to mount. The task-copies thread will fill that case with a frozen copy (APFS clone / reflink).
  • fork --branch NAME: for a workspace fork, the new git::switch_new writes .git/HEAD and the branch at the commit FROM is on (resolving loose refs and packed-refs), keeping files and the index, like git switch -c. It refuses names the repository (or its remote, for partial clones) or FROM already has. Saved times are carried over, so the fork's files keep their modification times.
  • fork --read-only PATH: adds read-only paths to those FROM has (needed now that the clone case goes through fork).
  • Removed mount --uncommitted and mount --branch (no users yet, so no compatibility shim).
  • README: the task-copy section now uses fork, plus a short git-to-sandfs table (clone, worktree add/list/remove). sandfs-cli README and changelog updated.

Testing

  • Task copies of a local repository: mount --branch, --uncommitted, rm --unmount #152's end-to-end test now runs through fork: started from a subfolder of the clone, with --branch and --read-only, every kind of uncommitted change, frozen start, push back; a second fork made from a subfolder of the first mount keeps its commit and staged file on a new branch; refusals for existing branches (repository, fork, remote, partial clone), bad names, a folder source, a plain folder and an existing name, with nothing left behind.
  • Tried on a VS Code clone with uncommitted work: sandfs fork . DIR --branch x took 0.14 s, and a fork from src/vs inside that mount 0.17 s.
  • cargo clippy --workspace --all-targets -D warnings and cargo fmt --check are clean. cargo test -p sandfs-cli passes on Linux FUSE except the two sandfs shell tests, which need bubblewrap, missing in this container; CI covers them.

Conflicts with #153 (safe changes --copy-to) are expected in the Fork arm and the end of git::start; whichever lands second keeps both.


Generated by Claude Code

`sandfs fork FROM DIR` now takes a folder of a git repository on this
machine as FROM, making a workspace of its HEAD plus the files its folder
has changed since, and any folder inside a mount, which forks that
workspace. `--branch NAME` starts git in the fork on a new branch at FROM's
commit, keeping its files and index, and `--read-only PATH` adds read-only
paths. A plain folder outside any repository is refused for now.

`mount --uncommitted` and `mount --branch` are removed: `mount` is the
live view again, and `fork` is the one way to make a task copy. The README
gains a git-to-sandfs table.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01XW4S6E1zKKGLEikvwvoMrz
@lydakis lydakis self-assigned this Oct 26, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T00:28:54.509840Z ead5aec New commits
🔒 Security Review ✅ Completed 2026-10-26T00:33:13.061972Z ead5aec New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3919ea82fc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/sandfs-cli/src/main.rs Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants