Re: [PATCH] copy: prefer reflinks for file copies
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 11, 2026, 15:27 UTC
- Message-ID
- <xmqqtsp03cey.fsf@gitster.g>
- In-Reply-To
- <pull.2380.git.git.1786460606222.gitgitgadget@gmail.com>
"Vlad Petric via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 6 quoted lines
> For local clones, try a reflink before the existing hardlink path. The > resulting order is therefore: > > - reflink; > - hardlink, unless --no-hardlinks was requested; > - byte-for-byte copy.
If copy-on-write works in situations where hard links are not available, using it as a fallback might make sense. However, we are talking about object files that are immutable. You have no reason to update them to trigger copy-on-write at all. The only changes you would make in the destination directories in the new repository's '.git/objects/' are removal or creation, never modification. Therefore, I do not understand why anyone would want to use the above order. Could you elaborate?
Thanks.