Skip to content

Sync LFS objects across repos.#39

Open
vorporeal wants to merge 8 commits into
mainfrom
david/mirror-lfs-objects
Open

Sync LFS objects across repos.#39
vorporeal wants to merge 8 commits into
mainfrom
david/mirror-lfs-objects

Conversation

@vorporeal
Copy link
Copy Markdown
Contributor

@vorporeal vorporeal commented May 13, 2026

Description

Git sync only transfers commits and LFS pointer files, which can leave the target repo referencing LFS objects that were never uploaded to its LFS store. This mirrors the referenced LFS objects during sync by detecting LFS pointer files, fetching the exact source objects, and pushing only those object IDs to the peer repo before the sync branch is pushed.

The implementation is intentionally conservative: private-to-public mirroring runs against the stripped clean snapshot, filters pointer-shaped files down to paths actually tracked by Git LFS, scans all pointers when .gitattributes changes, and logs the paths associated with each mirrored object. LFS payload materialization uses exact git cat-file --filters paths with historical attributes, avoids path-list parsing pitfalls, and fails closed if filters return the expected pointer instead of payload bytes.

This also enforces that text LFS payloads do not contain repo-sync private markers, wires that validation into the marker-check action, configures Git LFS filters in the sync workflow, and bounds pointer detection reads so large LFS payloads are not loaded into memory just to check for an unsmudged pointer.

Testing

  • uv run pytest tests/stack/test_lfs.py tests/stack/test_git_ops.py tests/test_lfs_payload_validation.py tests/workflows/test_lfs_mirroring.py tests/workflows/test_sync_workflow_config.py
  • uv run pytest tests
  • git --no-pager diff --check

Co-Authored-By: Oz oz-agent@warp.dev

@cla-bot cla-bot Bot added the cla-signed label May 13, 2026
Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vorporeal vorporeal requested a review from captainsafia May 19, 2026 14:37
@vorporeal vorporeal marked this pull request as ready for review May 19, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant