Skip to content

Could ttsc share caches across Git worktrees? #1470

Description

@imjlk

I'm using multiple Git worktrees for the same repo, and each worktree ends up with its own ttsc build cache.

Even a 2–3 GB cache per worktree adds up to 10–15 GB with just five worktrees, potentially using the same toolchain and plugin versions.

I saw #1185 addresses cache size limits. Would it also make sense to support sharing caches across worktrees of the same repository?

A few ideas that might help:

  • Share the source-plugin / Go build cache between worktrees. TTSC_GO_CACHE_DIR already allows manual sharing, but built-in support with automatic cleanup and protection for active builds would be helpful.
  • As a related improvement, share unchanged graph data using content-addressed chunks, with each worktree keeping references and its own changes. Only changed files and affected dependencies would need to be recomputed.
  • Since @ttsc/graph already supports incremental updates within a session, perhaps that could provide a starting point for reuse across sessions and worktrees too.

The graph idea could be a separate follow-up. Sharing the build cache alone would already help a lot when working on several branches in parallel.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions