change (diff) detection between multiple versions of a document

140 views
Skip to first unread message

Baba Pakruddin

unread,
Apr 11, 2017, 10:15:02 AM4/11/17
to Diff Match Patch
Hallo,


In google diff_match_patch we can compare two documents and get the difference. I am trying to calculate the diff's for multiple versions of a document.


 Ex. Doc.name -- version -- Diff 

             abc     --     v1      - v1 and v2
             abc      --     v2     - v1 and v3 
             abc      -      v3

can anyone explain the logic to do above example to store the example.

Thanks in advance.
Baba

askebi...@gmail.com

unread,
Dec 8, 2018, 2:33:22 AM12/8/18
to Diff Match Patch
I'm not 100% sure what you were asking. But I similarly needed to figure out a way to store the diff between multiple versions, preferably the delta text, since it doesn't include "equal" sections and is thus more space efficient.
And it turned out I just needed to store the delta both ways for each of them, and then at least one full copy of some point in the chain.

Fletcher Penney

unread,
Dec 8, 2018, 10:55:07 AM12/8/18
to diff-mat...@googlegroups.com
Technically, you only need to store the delta in one direction. It can easily be applied "forward", and then can be adjusted by recalculating offsets in order to be applied "backward". The calculation to do this is pretty quick, so should not add too much processing time and would cut storage space for the diffs in half if that is a concern.


Fletcher

--
Fletcher T. Penney
flet...@fletcherpenney.net
> --
> You received this message because you are subscribed to the Google Groups "Diff Match Patch" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to diff-match-pat...@googlegroups.com.
> To post to this group, send email to diff-mat...@googlegroups.com.
> Visit this group at https://groups.google.com/group/diff-match-patch.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages