Subject: Re: bug#61386: [PATCH] cp,mv,install: Disable sparse copy on macOS

From: Pádraig Brady <[email-masked]>
Date: Fri, 10 Feb 2023 21:46:35 +0000

On 10/02/2023 20:45, Paul Eggert wrote:
> On 2/10/23 10:58, Pádraig Brady wrote:
>> I was considering "touch"ing the timestamps after also,
>> but it's better to just maintain them as we're
>> pointing to the same data after all.
> 
> For POSIX conformance we must touch if the user has specified only POSIX
> options (and has not specified -p).
> 
> And it's not just a POSIX conformance issue. Ordinary users will be
> surprised if plain 'cp A B' creates a file B with a timestamp from last
> year.

Maybe. Though POSIX says cp "shall copy" and we're not making a copy, we're making a reflink.
So technically we're violating POSIX already in that regard.
One might take the view that the fact we write no new data
means we should not update the data modification time etc. by default,
and this may be more signal to a user that new data has not in fact been written.

> Likewise for B's modes.

Yes agreed on this. We'll have to honor umask etc.

> There's another complication: recent macOS versions have CLONE_ACL, and
> we're not using that.

Oh right, we should consider that too.

thanks,
Pádraig