Keith Devens .com |
Saturday, August 30, 2008 | ![]() |
| Nonsense on stilts! – Derived from Jeremy Bentham | ||
|
| ← Testing Weblog APIs | Hypocritical outrage at civilian casualties → |

Simon Willison (http://simon.incutio.com/) wrote:
Keith (http://www.keithdevens.com/) wrote:
I was thinking about that today.
I've seen people refer to the "GNU diff algorithm", but have never seen that documented anywhere. I suspect that it's one of those where "the code is the documentation", but that just sucks.
Keith (http://www.keithdevens.com/) wrote:
Anyway, I see nothing wrong with calling out to the diff utility. It's not like it's something that has to be done on every invocation - or even often. No reason that everything has to be written in one language.
As for storing the diffs instead of the full revisions. It would be nice for saving space, but then when you want to review an old revision, you have to repeatedly apply every diff from now until back then to get the original revision. It might be better to just compress old revisions to save space.
Dean Peters (http://www.HealYourChurchWebsite.com) wrote:
On and on with the content management system -- still no sharing the goods.
Don't you love us anymore?
Keith (http://www.keithdevens.com/) wrote:
It's not done yet!! Aaaaaaaaaah 
Mean Dean (http://www.healyourchurchwebsite.com) wrote:
sniff -- sniff -- well you didn't ahve to yell at me -- sniff
Feel free to post a comment below. Please see my comment policy.
Formatting Rules (No HTML):
Generated in about 0.219s.
(Used 8 db queries)

I've been writing a Wiki as well recently. The hardest problem by far (in my opinion) is revision control and diffs. Ideally you want to store the difference between one version and the previous version rather than just storing complete copies whenever an edit is made, but writing a diff algorithm (or finding one that has already written) in PHP is very hard. I ended up cheating and making a call out to the unix diff utility, but I'd much rather use something in pure PHP.