Skip to content

changes --copy-to never loses a file changed where it copies - #153

Merged
lydakis merged 3 commits into
mainfrom
claude/project-thread-clh2lc
Oct 26, 2026
Merged

lydakis merged 3 commits into
mainfrom
claude/project-thread-clh2lc

Conversation

@lydakis

@lydakis lydakis commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Requested by George · project thread

Copying a task's results back into the folder it came from (sandfs changes NAME --copy-to "$PWD") used to overwrite whatever it listed. If you had edited one of those files in the meantime, your edit was lost. Because of that, Sonny's role text had to tell the lead to keep its hands off a task's files until the task was done.

Changes

  • Conflict check in copy::copy_to: before anything is written, it compares every listed path in DIR with two states: what the workspace started from, and what the copy would write there. If the file differs from both (it was edited, deleted or replaced in DIR since), the whole copy is refused, and the error names each such file. --force overwrites, as before. A path that is missing from DIR is always written, so copying into an empty folder (--copy-to ~/kept) works as before. Modes are not compared. A folder counts as unchanged only if everything in it is in the workspace's start as the same kind of thing (so a link in place of a starting folder is a change).
  • What "started from" means: without --since, it is the source plus the uncommitted files a fork of a clone copied in. git::start now keeps those files in workspaces/NAME/start/ (Home::keep_start, hard-linked objects), and forking a workspace carries that snapshot along (Home::copy_start). With --since, it is the --since workspace. For a host folder copied back into itself, the source is that same live folder, so the check can't see edits there. The README says so, and the frozen plain-folder fork that comes next fixes it.
  • Two fixes in copy-to: a file being deleted that sits below a link or a file in DIR is already gone from DIR, so it is skipped instead of failing. A deleted file that a folder replaced, both in DIR and in the workspace, now leaves that folder alone instead of failing with EISDIR.
  • The sandfs-cli README and the changelog are updated. Rebased onto One fork command for task copies, from a clone or a mount #154 (one fork command).

Testing

  • New unit test files_changed_where_they_are_copied_are_never_lost covers an untouched file, an edited file, an edited deleted file, a folder that gained a file, a link put in place of a starting folder, and --force.
  • The end-to-end task-copy test (a_fork_of_a_clone_carries_uncommitted_files_and_pushes_back_on_its_own_branch) now copies back into the repository. It shows that the uncommitted files the copy started with are replaced, that a file edited since refuses the copy with nothing written, and that --force writes it anyway.
  • cargo clippy --workspace --all-targets -D warnings and cargo fmt --check are clean, and cargo test -p sandfs-cli passes on Linux FUSE.

Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01LAgZE9cvrECwdHFyP41Vd2

@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:41:51.715455Z 849d9db New commits
🔒 Security Review ✅ Completed 2026-10-26T00:43:51.239595Z 849d9db 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: 14cf8df015

ℹ️ 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/copy.rs Resolved
A file in DIR that differs from both what the workspace started from and
what the copy would write refuses the copy before anything is written;
--force overwrites. A workspace made with --uncommitted keeps what it
started from, so its copied-in files count as its start.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LAgZE9cvrECwdHFyP41Vd2
@lydakis
lydakis force-pushed the claude/project-thread-clh2lc branch from 15cd1cd to 849d9db Compare October 26, 2026 00:40
@lydakis
lydakis merged commit 8b95c32 into main Oct 26, 2026
23 checks passed
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