2

What Unix program generates "diff"s between text files (or INSERT/UPDATE/DELETEs for databases) in such a way that the order that the "diff"s are applied in is irrelevant, and the result is the same regardless of order.

Etherpad used to do something like this.

Example (for a given document or database):

% Adam makes a change X, then Bob makes a change Y, then Adam makes another change Z.

% However, because of network latency, Adam sees the changes in this order: XZY, while Bob sees them in this order: YXZ.

% However, the code/changes are written so that XYZ and YXZ yield the same result.

Note: ideally, this can be done without having to do X/Y/Z inverse at any point.

I have read Operational Transformation library? but I'm not sure this really does what I want.

oguz ismail
  • 1
  • 16
  • 47
  • 69
  • OT is certainly what you're after, especially to get the "XYZ == YXZ" that you want. I just added an answer to the question you linked to that might help, though Ceda currently has no *nix port. – Daniel Paull Jul 28 '10 at 07:55

1 Answers1

0

Git (or any smart version control system) will provide this functionality.

Yann Ramin
  • 32,895
  • 3
  • 59
  • 82
  • I hadn't thought about it, but I think you're right. Except, in this case, we're doing it character-by-character instead of line by line (and using an optimized version of "diff" to send deltas?). OK, how would we do this w/ an SQL database, short of storing it as text files? –  May 31 '10 at 02:37