emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dired C idea


From: Arthur Miller
Subject: Re: Dired C idea
Date: Wed, 04 Aug 2021 10:50:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Fabrice Bauzac-Stehly <noon@mykolab.com> writes:
>
>> Michael Albinus <michael.albinus@gmx.de> writes:
>>
>>> Michael Albinus <michael.albinus@gmx.de> writes:
>>>
>>>>>   > Should be feasible. The hard part is a rule to determine, whether 
>>>>> rsync
>>>>>   > is better suited than the existing implementation, with the given 
>>>>> actual
>>>>>   > arguments. I suspect, that small directories and/or short files are
>>>>>   > better served with the current implementation.
>>>>>
>>>>> Do we really need to decide this?  Wouldn't it be ok to use rsync
>>>>> for all cases (where Tramp is not in use)?
>>>>
>>>> I would like to see some benchmark figures first. For example, I'm not
>>>> sure that rsync performs better when the target directory does not exist
>>>> yet, and there's nothing to sync.
>>>
>>> I made some comparison between "cp -pr" and "rsync -pr" on shell
>>> level. I've copied the whole Emacs tree to somewhere else. First the
>>> case, that the target does not exist:
>>
>> Beware, "cp -pr" preserves timestamps, while "rsync -pr" does not.
>> You'd have to add "-t" to rsync, which should make it much quicker when
>> the files are already there, because then rsync will trust stat(2)'s
>> mtime and size, skipping the actual opening and scanning of the files'
>> contents.  But if we don't trust this heuristics we would add
>> --ignore-times.  Also if we want to skip the rsync checksum scanning, and
>> mimic "cp" more, we can add --whole-file.  But it depends on what we
>> want to do?
>>
>> The original use case of rsync is, of course, to synchronize things; in
>> particular, it will not prompt the user before overwriting a file, which
>> could be dangerous.  It can silently avoid overwrites with
>> --ignore-existing, though.  For this reason, I'm not sure it would be
>> wise to place it on the C key as replacement to the copy?
>>
>> Another area where rsync shines is the possibility to fine-tune the
>> copying: --delete, rich filters on the sender and/or the receiver sides,
>> --copy-dest...  But then, precise control over the options is required,
>> so why not achieve that with the "!" key in Dired?
>>
>>   ! rsync -rt "--filter=-s *.dat" --delete * /tmp/ RET
>
> Looks like a job for the newly merged transient library!

I woujld like to see something like `sync-directories-dwim
style'. For the filters maybe something like `copy-if', `delete-if' or
some other more integrated way with Emacs and Dired. Nothing against
transient, just the way I would prefer to have it. I use rsync from
Emacs already as from the links I posted.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]