Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildAuthorList ¶
BuildAuthorList deduplicates all (may contain duplicates), sorts alphabetically, then prepends current as the first entry (removing it from its sorted position if present). If current is empty, the sorted deduplicated list is returned as-is.
func FillOutForm ¶
func FillOutForm( ctx context.Context, cfg *config.AppConfig, defaults tui.CommitOption, hs historyStore, initialPrefill map[string]any, ) ([]byte, tui.CommitOption, error)
FillOutForm presents the commit TUI form and orchestrates the ctrl+r history flow. hs must not be nil; pass a *store.Store opened from store.OpenRepo.
Exit conditions:
- form completed → saves payload to history, assembles and returns the commit message.
- ctrl+r → shows history picker, then re-opens form (pre-filled or blank).
- ctrl+c / esc → returns ("", zero, huh.ErrUserAborted).
Types ¶
type IssueHint ¶ added in v0.6.0
IssueHint carries issue context detected from the current branch. Zero value means no issue branch — form fields are left unchanged.
func (IssueHint) Prefill ¶ added in v0.8.0
func (h IssueHint) Prefill(items []config.CommitItem) map[string]any
Prefill returns the issue-hint contribution to a FillOutForm prefill map. IssueID populates one field using the fallback chain
"scope" → "footer" (as "Refs: <id>") → "subject" (as "(<id>)").
BranchType is emitted as "type" when non-empty; loadForm validates it against cfg.CommitTypes and silently ignores an unconfigured value.