program hooks are hooks into the application that allow you to change and expand how the program behaves. these come in the form of small scripts that are called at important times as the application carries out actions. for example, when the application imports images there is a pre-import hook, this allow you to perform any action on the image just before importing into the archive. a normal way to use this hook is to call external programs such as lmagemagic to create displayable images from RAW images or create DNG images from RAW.
The hooks subdirectory is, by default, filled with templates for various repository hooks.
Scripting Languages These hook scripts can be in any scripting language, however Python is the preferred language (see python).
There is one template for each hook that the SIA implements, and by examining the contents of those template scripts, you can see what triggers each such script to run and what data is passed to that script. Also present in many of these templates are examples of how one might use that script, in conjunction with other SIA supplied programs, to perform common useful tasks. To actually install a working hook, you need only place some executable program or script into the repos/hooks directory which can be executed as the name (like start-commit or post-commit) of the hook.
On Unix platforms, this means supplying a script or program (which could be a shell script, a Python program, a compiled C binary, or any number of other things) named exactly like the name of the hook. Of course, the template files are present for more than just informational purposes—the easiest way to install a hook on Unix platforms is to simply copy the appropriate template file to a new file that lacks the .tmpl extension, customize the hook's contents, and ensure that the script is executable. Windows, however, uses file extensions to determine whether or not a program is executable, so you would need to supply a program whose basename is the name of the hook, and whose extension is one of the special extensions recognized by Windows for executable programs, such as .exe or .com for programs, and .bat for batch files.