Problem
Commit messages and PR titles/bodies are written by hand. Users who
want to delegate that to a script or an AI assistant have no hook in
git-spice to do so, and no way to have a generated message update an
existing change request as a stack evolves.
Proposal
Add user-configurable message generation: a spice.messageGenerator
config plus a --fill/-c flag that wires a script into
commit create, commit amend, branch create, branch submit, and
branch squash. The script generates commit messages or PR
titles/bodies from the change context.
- New
msggen package runs scripts in shebang or sh -c mode and
forwards the invoking command's argv as positional parameters.
Scripts run in the repo root with context env vars
(GS_MESSAGE_KIND, GS_MESSAGE_UPDATE, GS_BRANCH, GS_BASE,
GS_MESSAGE, GS_TITLE, GS_BODY).
--fill composes with -m/-F, so a generator failure falls back to
a user-supplied message.
- Forge support for editing a change request's subject and body
(GitHub, GitLab, Bitbucket, ShamHub) so a generator can iterate on an
open CR, not just new ones.
The shell-level contract is shared with the integration and restack
conflict resolvers (see #3 / scriptrun) so all script-driven recipes
behave consistently.
Tracked by
Problem
Commit messages and PR titles/bodies are written by hand. Users who
want to delegate that to a script or an AI assistant have no hook in
git-spice to do so, and no way to have a generated message update an
existing change request as a stack evolves.
Proposal
Add user-configurable message generation: a
spice.messageGeneratorconfig plus a
--fill/-cflag that wires a script intocommit create,commit amend,branch create,branch submit, andbranch squash. The script generates commit messages or PRtitles/bodies from the change context.
msggenpackage runs scripts in shebang orsh -cmode andforwards the invoking command's argv as positional parameters.
Scripts run in the repo root with context env vars
(
GS_MESSAGE_KIND,GS_MESSAGE_UPDATE,GS_BRANCH,GS_BASE,GS_MESSAGE,GS_TITLE,GS_BODY).--fillcomposes with-m/-F, so a generator failure falls back toa user-supplied message.
(GitHub, GitLab, Bitbucket, ShamHub) so a generator can iterate on an
open CR, not just new ones.
The shell-level contract is shared with the integration and restack
conflict resolvers (see #3 / scriptrun) so all script-driven recipes
behave consistently.
Tracked by