Skip to main content

seed_template_notes

Function seed_template_notes 

Source
pub fn seed_template_notes(
    review_provider: &dyn ReviewProvider,
    kind: ProviderKind,
    created: &[String],
    desc_branch: Option<&str>,
    dry_run: bool,
) -> Result<()>
Expand description

Prepare each freshly created review’s body before the managed sections go in. Create-only - existing reviews keep whatever body they have.

With a repo PR/MR template (and stk.usePrTemplate on), a branch with no --desc wraps the template in the managed description block as its opening prose. The --desc branch (named by desc_branch) ignores the template entirely - the description replaces it - so all that happens there is create_review’s subject echo (seeded when the commit had no body) is dropped, leaving the description clear of a redundant copy of the title. A branch with neither a template nor a description keeps its subject placeholder untouched. The template’s source is always the commit body, never the subject echo.