Skip to main content

Module policy_transforms

Module policy_transforms 

Source
Expand description

The fixed argument transforms of a forwarded command, in order. What: The fixed argument transforms of a forwarded command, in their fixed order: atomic push, commit-only, status hints off. Why: These are not policies: they have no severity and cannot be configured. They add --atomic to git push, -o to git commit and -c advice.statusHints=false before git status, and the commit-only transform can reject a commit. The decisions belong to the pure rule cores; this module runs them in order and fetches the two repository facts commit-only may ask for.

In TS you’d write (pseudocode):

// const { args, events, complete } = await applyFixedTransforms({ args, rawArgs, sequence });

Structs§

TransformResult
What: What the transform stage produced. A struct is a record with named fields; Vec<T> is an owned list; bool is true or false. #[derive(...)] asks the compiler to generate cloning, debug printing and ==. Why: The caller forwards arguments only when no event blocks and complete is true.

Constants§

COMMIT_ONLY_CORE
What: The identifier of the commit-only transform in its events. &str is borrowed text baked into the program. Why: A fixed-transform rejection names its transform where a finding names its policy.

Functions§

apply_fixed_transforms
What: Apply the three transforms in order. &[OsString] borrows the arguments, already free of wrapper controls. Why: The order is the incumbent’s: atomic push, commit-only, status hints. A rejection or failure of commit-only ends the stage with the stage’s input unchanged.