Bug 476194 - In more cases, the default behavior in Synchronizer should be to overwrite files
Summary: In more cases, the default behavior in Synchronizer should be to overwrite files
Status: REOPENED
Alias: None
Product: krusader
Classification: Applications
Component: synchronize (show other bugs)
Version: 2.8.0
Platform: Other Linux
: NOR grave
Target Milestone: ---
Assignee: Krusader Bugs Distribution List
URL:
Keywords:
: 497951 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-10-28 11:51 UTC by Duns
Modified: 2025-01-28 20:06 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
screenshot of this bug (204.80 KB, image/jpeg)
2023-10-28 11:51 UTC, Duns
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Duns 2023-10-28 11:51:18 UTC
Created attachment 162615 [details]
screenshot of this bug

SUMMARY
***
With the new release of synchronizer it is impossible, even after selecting "asymmetric", get synced only the changed files: you have to change all your files.
***


STEPS TO REPRODUCE
1. Open synchronizer
2. Do compare (with asymmetric option)
3. Do synchronize: nothing to do (nothing to sync)

OBSERVED RESULT

No more sync possible. You have to copy all your files.

EXPECTED RESULT

Sync the changed files in the left side.

SOFTWARE/OS VERSIONS
Operating System: KDE neon 5.27
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.111.0
Qt Version: 5.15.11
Kernel Version: 6.2.0-35-generic (64-bit)
Graphics Platform: X11
Processors: 3 × AMD Athlon(tm) II X3 455 Processor
Memory: 7,3 GiB of RAM
Graphics Processor: AMD RS780
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: GA-78LMT-S2

ADDITIONAL INFORMATION
Comment 1 Teimuraz Khazaradze 2024-04-30 10:06:34 UTC
I have the same error

ADDITIONAL INFORMATION:
Operating System: Kubuntu 24.04
KDE Plasma Version: 5.27.11
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.13
Kernel Version: 6.8.0-31-generic (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 7 5700G with Radeon Graphics
Memory: 58.7 ГиБ of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: Micro-Star International Co., Ltd.
Product Name: MS-7C95
System Version: 1.0
Comment 2 Alexei Pastor 2024-06-28 21:49:01 UTC
I have the same bug. It is impossible to synchronize two folders in asymmetric mode. It just mark all "different" files by "!=", but it schould to mark them by "<-".

ADDITIONAL INFORMATION:
Operating System: Debian 12
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Kernel Version: 6.1.0-21-amd64 (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i5-3470 CPU @ 3.20GHz
Memory: 7,7 GiB of RAM
Graphics Processor: NVE7
Manufacturer: Gigabyte Technology Co., Ltd.
Comment 3 Alex Bikadorov 2024-07-13 17:51:15 UTC
To clarify the specific case:

If "Asymmetric" is activated and "Ignore Date" is activated
  and source and target have a file with the same path
then 
  actual behavior is that synchronizer requests no default action for this file
  but expected behavior is that default action is file overwrite from source to target

The default action in this case  was intentionally changed to avoid unwanted overwriting of files (in case target and source are mixed up), see https://phabricator.kde.org/D26887 .

It is still possible to have the desired action by selecting all "!=" files and select "Copy from right to left" in the right-click context menu (but might not be feasible if there are a lot of files).

I think that the new behavior is very confusing - I could not understand it before looking into the code and finding the change request.

And I suggest to change it again: (only) if "Asymmetric" and "Ignore Date" is activated, the default action should be "Copy from right to left" again.

Other opinions?
Comment 4 Bug Janitor Service 2024-07-20 17:45:34 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/krusader/-/merge_requests/138
Comment 5 Toni Asensi Esteve 2024-07-20 17:58:51 UTC
> And I suggest to change it again: (only) if "Asymmetric" and "Ignore Date" is activated, the default action should be "Copy from right to left" again.

> Other opinions?

It looks good to me. 

So, there's a new merge request with that idea: https://invent.kde.org/utilities/krusader/-/merge_requests/138
Comment 6 Teimuraz Khazaradze 2024-07-21 08:12:48 UTC
(In reply to Alex Bikadorov from comment #3)
 
> And I suggest to change it again: (only) if "Asymmetric" and "Ignore Date"
> is activated, the default action should be "Copy from right to left" again.
> 
> Other opinions?

I think "Asymmetric" flag is enough to copy from the right and overwrite the left files. This is not only my opinion, this is  how the program should behave according to the documentation. Take a look on the quote from the the Krusader Synchronizer documentation:

---
Asymmetric: The Left Directory is the target folder, the Right Directory is the source folder. This function synchronizes the content of the left folder to the right folder.
 *   The files that exist only on the left side will be deleted.
 *   The files that exist only on the right side will be copied to left.
 *   The files considered to be equal will be untouched.
 *   Those files considered to be different will be copied to left. Use this feature with care!
---

Last sentence definitely says: Asymmetric mode (regardless of the other options) must make left content the same as the right one, event if left files are newer.

Personally, I've been using Krusader Synchronizer to copy the contents of my home directory from Desktop -> External SSD -> Laptop and vice versa for years. Obviously I am dazed and confused by the changes in behavior. Someone please restore the Synchronizer as it should be.
Comment 7 Alex Bikadorov 2024-08-01 12:07:05 UTC
>I think "Asymmetric" flag is enough to copy from the right and overwrite the left files. This is not only my opinion, this is  how the program should behave according to the documentation.

The documentation could (and should) be adapted. 

I would still prefer the solution with "Ignore Date" being used. It is safer which was the intention of the https://phabricator.kde.org/D26887 and requires only one click more by the user. But I leave the decision to Toni (see https://invent.kde.org/utilities/krusader/-/merge_requests/138#note_1003388 )
Comment 8 Toni Asensi Esteve 2024-08-10 07:33:46 UTC
Git commit 085753c5332ccce70d6003c711463e46e554ac10 by Toni Asensi Esteve.
Committed on 03/08/2024 at 19:32.
Pushed by asensi into branch 'master'.

Synchronizer: Make 'Copy from right to left' the default action if 'Asymmetric' and 'Ignore Date' are activated

Make "Copy from right to left" the default action in Synchronizer if those
options are checked: "Asymmetric" and "Ignore Date".

Credits for Alex Bikadorov.

FIXED: [ 476194 ] In more cases, the default behavior in Synchronizer should be to overwrite files

Revision: https://invent.kde.org/utilities/krusader/-/merge_requests/138

M  +5    -6    app/Synchronizer/synchronizer.cpp

https://invent.kde.org/utilities/krusader/-/commit/085753c5332ccce70d6003c711463e46e554ac10
Comment 9 Teimuraz Khazaradze 2024-08-10 09:22:17 UTC
Too pity. 

This a a step away from the "Unix way". When I say "Asymmetric" I don't care about dates, file existence or size or whatsoever. I just mean "make left side same as right one". Following this approach we also should change "rm -rf *" behavior, add an argument like --yes_i_mean_what_i_say. Just "to avoid that the default action is to delete a file even it is vital library". What also upsets me is that this is a change to an existing and familiar feature, and not a new one.

Sorry for my emotions as I had messed up files in my notebooks home directory because new files was not copied from the desktop.
Comment 10 Toni Asensi Esteve 2024-08-10 17:26:48 UTC
If someone doesn't care about dates, the "Ignore Date" checkbox is useful. With it, users can control if Synchronizer takes dates into account or not.
    
Even if "Ignore Date" is enabled, the user is still able to overwrite a file (by right-clicking it and selecting "Copy from right to left").

To avoid data losses, the behavior of "if dates are not ignored, the default is {not to overwrite a file by an old version of it}" is also the behavior in Total Commander and in Double Commander.

If you can follow the steps of
    https://commits.kde.org/krusader?path=INSTALL
in order to build the git version of Krusader, then you can do some tests with the latest version of Krusader.

If you have any problem about any particular case, you can write a little description and attach a screenshot (a lot ot times "a picture is worth a thousand words").
Comment 11 Toni Asensi Esteve 2024-08-10 19:01:17 UTC
Note: In my prior comment, when I wrote
    Even if "Ignore Date" is enabled, the user is still able to overwrite a file (by right-clicking it and selecting "Copy from right to left").                
I could have written:
    Even if "Ignore Date" is enabled or disabled, the user is still able to overwrite a file with an old version of it (by right-clicking it and selecting "Copy from right to left").
Comment 12 Teimuraz Khazaradze 2024-08-12 07:52:30 UTC
The synchronizer and default UNIX way behavior was one of the advantages of Krusader over many other  Commanders. Me and few other KDE users in our company are upset that convenience for professionals is being lost in favor of newbies.

Just for you to know: using mouse and selecting "Copy from right to left" is not a solution at all. Common scenario (I mean everyday scenario) of synchronizing /home/user/ directory includes 40000+ subdirectories and more than 220000+ files. Differences tree usually includes several thousand items. It is absolutely impossible to search and individually click mouse for tenth or hundredth time.

None of us is able to understand why the hell the long-standing and accepted behavior of the program was SUDDENLY changed??? What is the reason?

Personally me was using KDE everyday basis from the start of 2004. I can\t recall when I when i started using the Synchronize but I'm using it several time a week for many year. I'm sure there is no acceptable reason of this change.

Dixi
Comment 13 Toni Asensi Esteve 2024-09-14 17:54:39 UTC
Git commit 73c3f26cf106386282eabe184db29703222227e3 by Toni Asensi Esteve.
Committed on 14/09/2024 at 17:54.
Pushed by asensi into branch 'stable'.

Synchronizer: Make 'Copy from right to left' the default action if 'Asymmetric' and 'Ignore Date' are activated

Make "Copy from right to left" the default action in Synchronizer if those
options are checked: "Asymmetric" and "Ignore Date".

Credits for Alex Bikadorov.

FIXED: [ 476194 ] In more cases, the default behavior in Synchronizer should be to overwrite files

Revision: https://invent.kde.org/utilities/krusader/-/merge_requests/138


(cherry picked from commit 085753c5332ccce70d6003c711463e46e554ac10)

Co-authored-by: Toni Asensi Esteve <toni.asensi@kdemail.net>

M  +5    -6    app/Synchronizer/synchronizer.cpp

https://invent.kde.org/utilities/krusader/-/commit/73c3f26cf106386282eabe184db29703222227e3
Comment 14 Teimuraz Khazaradze 2024-09-14 18:17:25 UTC
> 
> And I suggest to change it again: (only) if "Asymmetric" and "Ignore Date"
> is activated, the default action should be "Copy from right to left" again.
> 
> Other opinions?

Can some explain me why the behavior in Symmetric and Asymmetric modes are different?

The Synchronizer in Symmetric mode make left and right sides equal, but in Asymmetric mode - NOT. Why?
Why for asymmetric mode user needs additional actions?

If someone needs to prevent newer files overwrite, please add new feature like checkbox "Prevent (or warn) newer files overwrite". Changing the existing and correct behavior is not a good idea. In my case and all users of Synchronizer whom I know overwriting new files is an expected action. For example, I just run some script for testing in left directory, and I need to restore it from right one to run test again. Other use case when overwrite is expected - synchronization of PC home directory to the external HDD. In fact, I do NOT have any use case, when Asymmetric is chosen but newer files on the left should not be overwritten

P.S. And please, do not even mention "right-click menu" in results tree. It is absolutely useless when working with thousands of items.
Comment 15 Alex Bikadorov 2025-01-28 20:06:47 UTC
*** Bug 497951 has been marked as a duplicate of this bug. ***