feat: use hard links for file copies when processing .worktreeinclude#11760
Draft
roomote[bot] wants to merge 2 commits intomainfrom
Draft
feat: use hard links for file copies when processing .worktreeinclude#11760roomote[bot] wants to merge 2 commits intomainfrom
roomote[bot] wants to merge 2 commits intomainfrom
Conversation
Adds an optional useHardLinks parameter to copyWorktreeIncludeFiles that creates hard links instead of full copies when the filesystem supports them. This saves disk space and speeds up worktree creation for large directories like node_modules. - Add hardLinkWithFallback method that falls back to copy on failure - Add hardLinkDirectoryRecursive for recursive directory hard-linking - Thread useHardLinks option through handler and message types - Add "Use hard links" checkbox to CreateWorktreeModal (defaults to on) - Add i18n keys for the new UI elements - Add tests for hard link behavior including inode verification Closes #11758
2 tasks
|
@roomote can you add the necessary translations to the locale files? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related GitHub Issue
Closes: #11758
Description
This PR attempts to address Issue #11758. Feedback and guidance are welcome.
When creating worktrees with
.worktreeincludepatterns, the system now supports using hard links instead of full file copies. Hard links point to the same underlying data on disk, which means:Key implementation details:
useHardLinksoptional parameter tocopyWorktreeIncludeFilesinpackages/core/src/worktree/worktree-include.tsfs.link()with automatic fallback tofs.copyFile()if hard linking fails (e.g., cross-device).worktreeincludeexists)Test Procedure
packages/core/src/worktree/__tests__/worktree-include.spec.ts:Pre-Submission Checklist
Documentation Updates
Additional Notes
.worktreeincludefile exists in the repositorynode_modulesand offer significant performance/space benefitsInteractively review PR in Roo Code Cloud