Skip to content

WIP: Add step in stage 2 post-receive to replace stage 1 hooks if they are different in the new active configuration

Madeline Haraj requested to merge mh/replace-stage1-hooks into develop

Summary

Currently the stage 1 hooks, that is the hooks that are actually present in the hooks directory of the target git repository are installed by symlinking them in from a basalt checkout that is separate from the one that it manages. On a push, the stage 1 hooks call the stage 2 hooks in the basalt of the configuration being activated. In this way, the git state of the target repo tracks the state of the stage 2 hooks, but not that of the stage 1 hooks.

This MR changes the way hooks are handled so that on installation the stage 1 hooks are instead copied into the hooks of the target repository and henceforth updated by the stage 2 post-receive hook on each successful push of a new active configuration. This means that the stage 1 hooks, barring some serious error such as power failure during a configuration change, are kept in sync with the state of the configuration.

The procedure is structured so as to be robust to such serious errors and a recovery procedure is detailed within the README.

Checklist for success

  • I have updated the changelog.
  • I have updated the README for any non-trivial changes.
  • My code is consistent with the Obsidian style guide.
Edited by Alex

Merge request reports