Stagit and Git Hooks

I’m using stagit to provide a static web interface for my git repositories and decided to make stagit-hook to provide an easy method of installing git post-update hooks that automatically run stagit.

When run without any arguments, the stagit-hook script behaves as a git hook by reindexing the repository specified by the GIT_DIR environment variable and generating a new index file. The reindex command behaves similarly, except that it operates on repositories specified as arguments. The install command simply calls stagit-hook-install script on the given repositories before running the reindex command.

It can be minimally configured in the /etc/stagit-hook configuration file allowing you to set the basedir and baseurl variables to determine the base of the HTML files and the base URL for generated links respectively.

While the script would work identically if it used itself as the post-update hook, instead it uses the stagit-hook-hook script which indirectly executes stagit-hook so that changes to the script don’t require reinstalling it in each repository.

Related
Git · Projects · Website