Vesta doesn't make the same assumptions that some other revision control systems do about files simply being lines of ASCII text. Because of this, if we want to provide an API for calculating diffs of files, we need a way to account for the various different file types that people might choose to store.
The first issue is finding a way to classify the files. This should be based on both file name patterns (*.c, *.xml, *.png, etc.) and also on contents. Good places to look so we don't have to reinvent the wheel would be:
libmagic1 which is used by file(1)
Apache's method of using mod_mime and mod_mime_magic
After that's solved, there's a few other issues:
- How to associate diff techniques with each type of file (another cfg file that gets included into vesta.cfg?)
- What to use as a default for unrecognized files
- How to return the diff results to the calling program
- How to diff files of two different types, or at least types that use different diff tools.