Skip to content

Feature use ref block cloning - #6460

Draft
qub1n wants to merge 10 commits into
git-for-windows:copilot/feature-use-ref-block-cloningfrom
qub1n:copilot/feature-use-ref-block-cloning
Draft

qub1n wants to merge 10 commits into
git-for-windows:copilot/feature-use-ref-block-cloningfrom
qub1n:copilot/feature-use-ref-block-cloning

Conversation

@qub1n

@qub1n qub1n commented Oct 5, 2026

Copy link
Copy Markdown

Hi there,

I spent some time with testing, fixing and optimizing ReFS support for git work tree implementation originally created with copilot and now I came to the point in which it works quite good.

Correctness was tested on artificial and real git repositories.

Overall the cloning is slower for small files, so I chosen threshold of files > 160KiB for which cloning happen on ReFS.

The last unaligned segment is not cloned, but rather copied due to performance.

image

I was comparing runs on two VHDX disk one with ReFS and second with NTFS on my laptop Acer Nitro V16. It is faster in almost all testing cases compare to original implementation with either NTFS or ReFS and in the same time it brings space savings around 30%, space saving was counted from occupied blocks on disk.

image

In common repositories threshold of 160Kb clone very small amount of files (in count), but good portion of size of repository. Lower threshold would mean slightly slower creating of work tree, but much bigger space saving.

image

qub1n added 10 commits October 4, 2026 00:41
…t expected to be cloned even it those files are clean, that is more conservative approach.
…ot needed because proper file size was set on file creation.
…kipped if worktree is created in empty folder
…segment is not cloned because cloning not aligned segment is slow, it is rather copied from source. Fixed and optimized check for source-clone for git repositories with autocrlf=false where cloning was not executed at all (facebook/react, microsoft/vscode, kubernetes/kubernetes).
@qub1n
qub1n marked this pull request as draft October 5, 2026 19:01

This branch has not been deployed

No deployments
Sign up for free to 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.

1 participant