Skip to content

Initial macOS workspace copy and later push disagree on ignored files #561

Open

Description

@hbrodin

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:

  1. Create a harmless file matched by .gitignore.
  2. Create the VM with coop up . --copy --exclude-git; the ignored file reaches /workspace.
  3. Remove the host file and run coop push --force --exclude-git.
  4. 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.
  • .git handling and the existing build/cache exclusions remain explicit rather than becoming accidental consequences of .gitignore parsing.

Related: #427 concerns deletion semantics in the opposite guest-to-host pull direction and does not cover this initial-copy/push inconsistency.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions