Skip to content

feat(core): optimize file copy with reflink/hardlink fallback - #237

Merged
ulises-jeremias merged 1 commit into
mainfrom
feat/issue-230-copy-optimization
Jul 22, 2026
Merged

feat(core): optimize file copy with reflink/hardlink fallback#237
ulises-jeremias merged 1 commit into
mainfrom
feat/issue-230-copy-optimization

Conversation

@ulises-jeremias

Copy link
Copy Markdown
Member

Summary

  • Add copy_file_efficient(): reflink/clonefile → hardlink → shutil.copy2
  • Wire plain-file copies in loaders through the optimized path
  • Allow disabling hardlinks via CPA_COPY_HARDLINK=0

Test plan

  • uv run pytest packages/create-python-app-core/tests/test_loaders.py
  • Scaffold a local file:// template and confirm files are written

Closes#230

Made with Cursor

Use cp reflink/clonefile, then hardlink, then shutil.copy2 for plain
template file copies (CNA parity). Hardlinks stay opt-out via
CPA_COPY_HARDLINK=0 and are skipped when allow_hardlink is False.
Closes#230
Co-authored-by: Cursor <cursoragent@cursor.com>
@ulises-jeremias
ulises-jeremias merged commit 9956457 into mainJul 22, 2026
13 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add copy performance optimization (reflink/hardlink fallback)

1 participant

@ulises-jeremias