Skip to main content

compose_hooks

Function compose_hooks 

Source
pub fn compose_hooks(
    template: &str,
    guard: Option<&str>,
    parts: &TrunkGuards<'_>,
) -> String
Expand description

The hook block from its authored template, for one pairing of the two Git workflow axes.

guard is the checkout mode’s answer: Some is the worktree mode, which carries the location guard, and None is the branches mode, which carries no guard entry at all rather than one that reads local state to decide whether to enforce.

parts is the integration mode’s answer. Under forge integration the two trunk guards render and the block is byte-identical to what every landed target already carries. Under local integration neither renders, because rk integrate writes the trunk commit and the operator pushes the trunk, and the header carries the pre-integrate note in their place.

The one branch grammar substitutes from BRANCH_GRAMMAR. Markers included, without a trailing newline and with its scope token unrendered.