views:

60

answers:

1

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 http://stackoverflow.com/questions/2043165/operational-transformation-library but I'm not sure this really does what I want.

A: 

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

Yann Ramin
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?
barrycarter