tags:

views:

44

answers:

1

Hello,

I am writing a PHP script that needs to interpret Diff files as created by Git. How should I proceed if I want to parse the Diff file and basically print it in a completely different format?

I have come across the Text_Diff PEAR library, but that one only creates the Diffs itself. Or rather, it only takes two different files as input. Is there a way to use that set of classes to achieve what I want (feed in a diff and get a tokenized diff as output, basically split up into the operations)?

+1  A: 

I will recommend you to take a look to the diff module drupal has, because the it use a Diff Engine class from a wiki that might be the solution you are looking for.

http://drupal.org/project/diff

redhatlab