9

So, i want to investigate git applicability to version tracking of certain binary or text tree data structures. The thing is that i want that the diff logic be completely custom, tailored for the data structure pattern.

Assume the file in question is certain json object, i want a custom diff for json files so if i have version A as this:

{ a: 'yes' , b: { 'X': 'unavailable' , 'Y': ready } }

and i apply the following change:

{ a: 'yes' , b: { 'X': 'unavailable' , 'Y': done } }

so my diff would be smart to spot that only the item 1 changed. With default diff, if someone else made a change in, say, in the key a, item [0] then this would produce a conflict that needs to be manually merged. The custom diff would aim to customize diff logic for specific file types and contents.

Something slightly different for binary files might also apply.

The purpose of this question is to see if there are:

  • ways in current git to support this customization
  • projects or branches of git development to support this customization
  • some other tool better aimed for this

thanks!

Edit i found this article, which i think gives a very broad scope of the sort of thing i'm wondering about. Also it is probably a sign that there is really no good solution for this problem as of yet.

lurscher
  • 23,085
  • 26
  • 113
  • 178
  • far from a complete answer; but here are some issues that affect tree object diff algorithms in general (not git specific) http://useless-factor.blogspot.com/2008/01/matching-diffing-and-merging-xml.html – lurscher Feb 14 '12 at 02:43

1 Answers1

2

You can create custom diff view for binary files (section "Diffing Binary Files") like Word documents. But this is useful only for viewing the differences, not for merging.

I don't know about anything that can help you with that.

Enno Gröper
  • 4,061
  • 1
  • 24
  • 32
svick
  • 214,528
  • 47
  • 357
  • 477
  • interesting, what i wrote above was based on the assumption that merge relied on the diff tool to do its job – lurscher Feb 06 '12 at 00:19