librelist archives

« back to archive

Re: [libgit2] custom diff logic for conflict detection

Re: [libgit2] custom diff logic for conflict detection

From:
Charlls Quarra
Date:
2012-05-24 @ 15:24

Hi

I've been trying to find a library to do efficient revision story for tree
in-memory objects
and i recently found libgit2, which i find extremely interesting.

Usually, with a tree data structure stored in file format (think of XML 
for instance)
version control systems will always use the source line as the unit of 
difference to manage
changes and detect conflicts.

What i'm investigating is a way to be able to customize the difference 
resolution logic, say
for tree in-memory objects (also, using a custom storage backend, which 
interestingly enough,
libgit2 provides an interface to override) so for example, i could detect 
differences in separate
sub-nodes but provide a straightforward logic to merge. In the case of 
trees, you know a lot
more about the data structure compared to when the structure is flatten 
out into a text file,
so this extra information can be used to improve the whole merge logic

Does libgit2 provide mechanisms to override the diff and merge logic in 
custom objects
(i would presume that the tree objects would present to the library 
opaquely as blobs, but 
with custom functions to do the diff and merge?