Repository navigation
fork of a plain folder: a frozen copy, its files cloned - #158
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
sandfs fork FOLDER DIR now takes a folder outside any workspace or git repository. Its files, links and folders are cloned with their modes and times into $SANDFS_HOME/copies (reflink: APFS, btrfs, XFS), so the fork is the folder as it was and changes --copy-to FOLDER can tell an edit made there since. A disk that can't clone is refused rather than copied in full. The copy is deleted with the last workspace over it (rm), or by clean. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LAgZE9cvrECwdHFyP41Vd2
A workspace made with SANDFS_HOME spelled through a link (as /tmp is on macOS) records its copy under that spelling; rm under another spelling took the copy for unused and deleted it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LAgZE9cvrECwdHFyP41Vd2
lydakis
force-pushed
the
claude/project-thread-clh2lc
branch
from
October 26, 2026 01:22
88609a8 to
808269e
Compare
This was referenced Oct 26, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by George · project thread
sandfs fork FROM DIRrefused a folder outside any workspace or git repository, so a task copy of a plain folder had to be asandfs mountof it. A mount is a live view: edits made in the folder show up in the copy, andchanges --copy-to FOLDERcouldn't tell an edit made in the folder since the copy started. This PR makes that fork a frozen copy, which was the last piece of the agreedforkdesign (#154, #153).Changes
Home::freeze(store.rs): clones the folder's files, links and folders, with their modes and modification times, into$SANDFS_HOME/copies/copy-XXXX/. The workspace is aBase::Dirover that copy, and itssourceis the original folder, for display. Files are cloned withreflink-copy(clonefile on macOS, FICLONE on Linux), which takes no space for their contents. On a disk that can't clone (ext4), or when the folder is on another disk than the home, the fork is refused with a message pointing tosandfs mount, instead of falling back to a full copy. Pipes, sockets and devices are left out with a warning. A folder that holds the home is refused, asresolvealready does.rmdeletes copies no workspace is over any more (Home::remove_unused_copies, under the exclusive repos lock thatcleantakes, so it can't race a fork that is being made).cleansweeps them too, and so does a failed fork or mount.remove_copymakes cloned read-only folders writable before deleting them, for a folder such as Go's module cache.fork_originreturnsOrigin::Folderinstead of refusing.--branchwith a plain folder is refused ("needs a git repository").reflink-copy0.1 (its Windows crates are only pulled in on Windows). The CLI crate forbids unsafe code, and this gives a safe clone call that fails rather than falling back to a full copy, whichstd::fs::copydoes on ext4.Testing
a_fork_of_a_plain_folder_keeps_it_as_it_was. On a disk that clones, it checks that the fork keeps contents, times, modes and links; that later edits in the folder stay out; thatchanges --copy-to FOLDERrefuses to overwrite a file edited there since and then copies; and that a snapshot shares the copy, which goes with the lastrm. On a disk that can't clone (Linux CI on ext4), it checks the refusal and that nothing is left behind. It must take the cloning path on macOS (APFS).TMPDIRon a btrfs loop device (cloning path). By hand on btrfs: a folder with a 50 MB file forked with no change in disk use, and 20,000 small files forked in 1.8 s (cp -R --reflink=alwaystook 2.2 s).--branchrefusal for a plain folder instead of the old "not supported" refusal.cargo fmt --checkandcargo clippy --workspace --all-targets -D warningsare clean, andcargo test -p sandfs-clipasses (116 + 12 + 27).On macOS, cloning goes file by file. If it is slow for large folders on George's Mac, cloning the whole tree in one
clonefilecall is the follow-up, but that needs FFI.Generated by Claude Code