Skip to main content

install_commit_hooks

Function install_commit_hooks 

Source
pub fn install_commit_hooks(
    auths_home: &Path,
    root_did: &str,
    device_did: &str,
) -> Result<PathBuf, CommitHookError>
Expand description

Install the prepare-commit-msg hook under <auths_home>/githooks and write the trailer + root-pin data files it reads.

Idempotent: rewrites the managed files unconditionally (a stale hook version is replaced). Does NOT touch git config — pair with enable_commit_trailers for the full wiring.

Args:

  • auths_home: The auths data directory the hook reads from at commit time.
  • root_did: The local identity’s root did:keri: (the Auths-Id value).
  • device_did: This device’s DID (the Auths-Device value).

Usage:

let hooks_dir = install_commit_hooks(&auths_home, &root_did, &device_did)?;