Repository navigation
Description
Summary
On macOS, the initial coop up --copy workspace transfer and later coop push do not apply the same ignore policy. The initial tar transfer can copy Git-ignored files into the guest; subsequent rsync pushes exclude those paths and therefore can leave the original guest copies stale even when they were removed from the host.
Current behavior
The initial copy uses tar_pipe_transfer_to. On macOS it cannot add GNU tar's --exclude-vcs-ignores, so it applies only DEFAULT_EXCLUDES plus the optional .git exclusion. Other paths ignored by the repository remain eligible for transfer.
Later coop push uses rsync with:
--filter=:- .gitignore
--delete
Rsync protects excluded paths from deletion unless --delete-excluded is used. The resulting sequence is:
- Create a harmless file matched by
.gitignore. - Create the VM with
coop up . --copy --exclude-git; the ignored file reaches/workspace. - Remove the host file and run
coop push --force --exclude-git. - Tracked edits refresh, but the ignored guest file remains because the push now excludes it from both transfer and deletion.
This makes /workspace neither a clean tracked-source snapshot nor a consistent mirror of the host directory.
Expected behavior
Initial copy and subsequent push should have one documented source-selection policy. A path omitted by that policy should not be introduced during initial staging or retained indefinitely because the transport changed.
This does not require treating every Git-ignored file as secret, and it should not silently delete user data without a deliberate contract. Possible designs include a tracked-working-tree snapshot mode, a shared manifest used by both transports, or explicit mirror semantics for excluded files.
Acceptance criteria
- Initial copy and push use a consistent, documented inclusion policy on macOS and Linux.
- Current contents of included tracked files, including unstaged edits, reach the guest.
- Ignored/excluded paths do not become stale solely because initial copy and push use different transports.
- Tests cover a positive tracked edit, an ignored file, removal between initial copy and push, and both tar and rsync paths.
.githandling and the existing build/cache exclusions remain explicit rather than becoming accidental consequences of.gitignoreparsing.
Related: #427 concerns deletion semantics in the opposite guest-to-host pull direction and does not cover this initial-copy/push inconsistency.
Activity