You either need to read more carefully, or you do not understand what "sync" means. Please do not add to public confusion about this.
1. Synchronization means making two directory trees identical -- same files, same count, no more, no less.
2. If tree B (destination) has more files than tree A (source), sync deletes files from B so it agrees with A.
3. If tree B has fewer files than A, files are added to B so it agrees with A.
4. If tree B has the same number of files, but different contents or dates, the sync program replaces them with files from tree A.
5. THEREFORE, ERGO, the operator MUST say which is the source, and which is the destination.
For the life of me I can't understand why people find this so confusing.
> Sync has always meant merging semantic changes in state between two or more devices.
YES, as clearly explained above. And that means if the user chooses the wrong source, for example a device with no music tracks, then the program will dutifully erase all the music tracks from the destination device.
> iTunes in the grandfather's case, chose to merge incorrectly and lose data.
Yes, but that outcome resulted, not from an error in iTunes, but from the user misidentifying the source device, and that, in turn, resulted from his not understanding sync, a misunderstanding that he revealed in his post by attempting to rely on an incorrect dictionary definition of the word.
EDIT: consider this hypothetical example.
1. Directory tree A has 9 files.
2. Directory tree B has 10 files.
3. In your description, the user doesn't have to say which is the source -- no user intervention is required.
4. If so, without user intervention, how does the sync program know what to do? Does it add a file to tree A, or delete a file from tree B?
Think before answering.
EDIT: Readers, do not downvote posts simply because you're confused. Ignorance is not a justification to cast a downvote.
> Sync has always meant merging semantic changes in state between two or more devices.
That is a definition of file synchronization [1]. Usually the aim of "syncing" is to input two directories and the outcome is that the contents of both directories are the same.
What you are describing below point 1. is an algorithm to achieve this goal.
The algorithm you describe needs a source and destination folder and this may be Apple's algorithm and implementation (I have no idea) but this is by no means the only way to do so (see two-way file synchronization [1]).
In that case, there are two strategies for synchronizing file systems -- either:
1. The operator tells the program what to do.
-- or --
2. The program gets it wrong at least some of the time.
In the case of contact list synchronization, like Google Contacts, the system assumes that the device the operator is editing at the moment is the source, and acts accordingly. Notice that a positive determination is made as to what the source and destination are, based on the operator's activity and its timing.
In all other cases where two directory trees are synchronized, are made to have the same content, and in which files may be deleted as well as added, the operator has to tell the program which is the source and which is the destination. End, full stop.
I agree that you need some user input or the program will get it wrong in some cases.
But the distinction between source and destination is relevant with some algorithms (one-way sync) and irrelevant in others.
Let say you have two directories A and B to sync and both contain a file f but the one in B is more recent than the one i A. A consistent strategy would be to always favor the most recent file and end up with A and B containing the same f file that was the one being in B at the beginning of the syncing. At no point I asked the user to define a source nor a destination but still the two directories are synced.
Note that it is your choice to continue or not the discussion as much as it was mine (not yours, shockingly) to answer your post.
So please keep your "End, full stop" and "Think before answering" to yourself, they are quiet annoying.
> But the distinction between source and destination is relevant with some algorithms (one-way sync) and irrelevant in others.
True, but the decisions made by the operator are critical to any desirable outcome, in all cases, without exception. Your example proves the point:
> Let say you have two directories A and B to sync and both contain a file f but the one in B is more recent than the one i A. A consistent strategy would be to always favor the most recent file and end up with A and B containing the same f file that was the one being in B at the beginning of the syncing.
Yes, unless that's not what the operator wants. Suppose the operator has edited a file as part of a programming project, but introduces a bug and simply wants to restore the system's original state with a minimum number of file operations. In that case, the operator wants older dated files to be copied over newer ones.
How shall the algorithm proceed? The operator tells it what to do.
> So please keep your "End, full stop" and "Think before answering" to yourself, they are quiet annoying.
If people understood the meaning of file synchronization, I wouldn't have to. All the replies suffer from naive assumptions contradicted by real-life experience, such as the OP losing his music collection as just one example, or the example I just gave -- things that happen to real people in the real world.
You're right, synchronization means making two directory trees identical. Nothing about that definition refers to or relies on the concept of a canonical source and a target to be wiped. That's cloning, which is a special case of synchronization.
You either need to read more carefully, or you do not understand what "sync" means. Please do not add to public confusion about this.
1. Synchronization means making two directory trees identical -- same files, same count, no more, no less.
2. If tree B (destination) has more files than tree A (source), sync deletes files from B so it agrees with A.
3. If tree B has fewer files than A, files are added to B so it agrees with A.
4. If tree B has the same number of files, but different contents or dates, the sync program replaces them with files from tree A.
5. THEREFORE, ERGO, the operator MUST say which is the source, and which is the destination.
For the life of me I can't understand why people find this so confusing.
> Sync has always meant merging semantic changes in state between two or more devices.
YES, as clearly explained above. And that means if the user chooses the wrong source, for example a device with no music tracks, then the program will dutifully erase all the music tracks from the destination device.
> iTunes in the grandfather's case, chose to merge incorrectly and lose data.
Yes, but that outcome resulted, not from an error in iTunes, but from the user misidentifying the source device, and that, in turn, resulted from his not understanding sync, a misunderstanding that he revealed in his post by attempting to rely on an incorrect dictionary definition of the word.
EDIT: consider this hypothetical example.
1. Directory tree A has 9 files.
2. Directory tree B has 10 files.
3. In your description, the user doesn't have to say which is the source -- no user intervention is required.
4. If so, without user intervention, how does the sync program know what to do? Does it add a file to tree A, or delete a file from tree B?
Think before answering.
EDIT: Readers, do not downvote posts simply because you're confused. Ignorance is not a justification to cast a downvote.