Skip to content

Make clone object sharing deliberate and extend it to LFS #154

Description

@blooop

Question

Workspace clones already share ordinary git objects with the per-repo bare cache — but only by accident: git clone <bare_path> <ws_path> (workspace_clone.py:270-278) takes git's local transport, which hardlinks pack files by default. Nothing states this, no flag pins it (--shared/--reference are absent), and the sharing is silently forfeited if the bare gets repacked or the cache crosses filesystems. Meanwhile LFS objects are NOT shared at all: the bare cache holds none, and _materialize_lfs runs git lfs pull origin per workspace (workspace_clone.py:150-170) — a repo with multi-GB LFS content pays full network + disk cost per workspace. Decide how object sharing becomes deliberate and whether/how it extends to LFS.

Decide against the principles (maintainability > simplicity):

  1. Ordinary objects: pin the hardlink behavior explicitly (e.g. --local, a comment + test asserting shared inodes), move to --shared/--reference (dangling-object hazards on prune — likely rejected for maintainability), or accept and document the accidental sharing. What breaks if a user's cache spans filesystems?
  2. LFS: share via lfs.storage config pointing every workspace at one cache-level LFS store, vs pulling LFS into the bare and cloning with smudge, vs status quo (documented per-workspace cost). Weigh concurrency (two launches pulling the same object), GC, and the existing GIT_LFS_SKIP_SMUDGE=1 flow (workspace_clone.py:270-278) with explicit _materialize_lfs.
  3. State how the outcome is tested (e.g. two workspaces of an LFS repo share the object store — one network pull, second workspace hits cache; inode-sharing assertion for pack files).

Interaction warning: a sibling build ticket (from #142) gates the LFS probe on repo content, and #144's build tickets change fetch flow in the same files — coordinate seams, don't collide. Code changes graduate as build ticket(s); this ticket only decides.

Pointers: devlaunch/worktree/workspace_clone.py:114-170, :270-335; devlaunch/worktree/repo_manager.py:94-99 (bare clone), :60-62 (layout).

Activity

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

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions