git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Vlad Petric via GitGitGadgetNext: Vlad Petric
Message 2 of 3 in “copy: prefer reflinks for file copies”
  1. copy: prefer reflinks for file copiesVlad Petric via GitGitGadget, Aug 11, 2026
  2. Junio C HamanoAug 11, 2026
  3. Vlad PetricAug 11, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.