Documentation
¶
Overview ¶
Package commit contains helpers to derive MR/PR metadata from a commit message.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Body ¶
Body returns everything after the first line, with surrounding whitespace removed. It is empty when the commit message has no body.
func BranchName ¶ added in v0.7.0
BranchName derives a branch name like "fix-detect" from a commit title. Rules:
- Input is the commit message title (first line). Whitespace is trimmed.
- If it matches conventional-commit form type(scope)!: description — word1 = type (lowercase, scope and ! stripped), word2 = first word of description.
- Otherwise fallback: take the first two usable words of the title.
- Each word is normalized: lowercased, keep only [a-z0-9] runes. Words that become empty after normalization are skipped.
- If only one usable word exists, return just that word.
- If zero usable words, return "" (caller falls back to timestamp).
func MRDescription ¶
MRDescription mirrors the Bash build_mr_description: when the commit has a body it is returned verbatim, otherwise a short "## Summary" description is generated from the title.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.