Skip to main content

handle_prepare_commit_msg

Function handle_prepare_commit_msg 

Source
pub fn handle_prepare_commit_msg(
    git_dir: &Path,
    commit_source: Option<&str>,
) -> Result<()>
Expand description

Handle the prepare-commit-msg hook.

Detects squash operations and writes pending-squash.json so that the post-commit hook can route to squash synthesis.

Detection signals (any one sufficient):

  1. commit_source argument is “squash”
  2. .git/SQUASH_MSG file exists
  3. CHRONICLE_SQUASH_SOURCES environment variable is set