Interactive commit builder and commit execution.
g commit has two paths:
- Guided / interactive — when no
--messageflag is given, the user is walked through a series of prompts (type, scope, subject, body, footer) to build a Conventional Commit message. - Non-interactive — when
--messageis given the prompts are skipped and the commit is made immediately.
In both cases the commit is executed via [gitcmd::git_output] and the
result is displayed with a coloured success/error summary.
Folder layout
commit/
mod.rs ← this file: public `commit()` entry point + orchestration
parse.rs ← pure helpers (extract_body, parse_conventional_type,
message_from_flags) with unit tests
preview.rs ← display helpers (show_staged_summary, colorize_stat_line,
type_label_parts)
dry_run.rs ← `--dry-run` path: print planned `git commit` invocation
builder.rs ← interactive + inline commit-message builders + type picker
Source:
src/commands/commit/mod.rs