Feature Request
Optimize template file copying by trying reflink (FICLONE) first, then hardlink, then falling back to recursive copy — instead of always using shutil.copytree.
Background
Template checkout copies hundreds of files. On supported filesystems (Btrfs, XFS, ZFS, APFS), reflink copies are near-instant and space-efficient. Hardlinks are a fast second option.
Suggested approach
- Try
os.copy_file_range() or fcntl.FICLONE on each file copy
- Fall back to
shutil.copy2() (preserves metadata)
- Avoid hardlinks for files that would be modified during template rendering (
.template suffixed files)
Reference
CNA uses a reflink → hardlink → recursive copy chain. Parity gap documented in the feature alignment sweep.
Feature Request
Optimize template file copying by trying reflink (FICLONE) first, then hardlink, then falling back to recursive copy — instead of always using
shutil.copytree.Background
Template checkout copies hundreds of files. On supported filesystems (Btrfs, XFS, ZFS, APFS), reflink copies are near-instant and space-efficient. Hardlinks are a fast second option.
Suggested approach
os.copy_file_range()orfcntl.FICLONEon each file copyshutil.copy2()(preserves metadata).templatesuffixed files)Reference
CNA uses a reflink → hardlink → recursive copy chain. Parity gap documented in the feature alignment sweep.