Skip to content

Restore commit-msg hook in the CLI - #2

Open
sensei-woo wants to merge 1 commit into
ameyypawar:fix/15209-cli-commit-hooksfrom
sensei-woo:fix/15209-commit-msg-hook
Open

Restore commit-msg hook in the CLI#2
sensei-woo wants to merge 1 commit into
ameyypawar:fix/15209-cli-commit-hooksfrom
sensei-woo:fix/15209-commit-msg-hook

Conversation

@sensei-woo

Copy link
Copy Markdown

Stacked on gitbutlerapp#15222. Merging this PR into the base branch will add commit-msg support directly to that draft.

Summary

  • run commit-msg after the provided or editor message has been resolved
  • apply hook message edits within the existing workspace transaction
  • roll back the commit when the hook rejects the message
  • honor --no-hooks and isolate hook fixtures from contributors' global core.hooksPath

This completes the commit-msg portion of gitbutlerapp#15209, including attribution hooks that edit the commit message.

Verification

  • cargo fmt --all -- --check
  • cargo test -p but --test but "command::commit::" --no-default-features --features legacy (71 passed)
  • cargo clippy -p but --test but --no-default-features --features legacy -- -D warnings
  • structured autoreview: clean, no actionable findings

The single commit is GitHub-signed and shows as Verified.

Resolve the final message before running commit-msg while the workspace transaction is still open. Hook edits are reworded into the same transaction, and failures roll back the commit. Tests cover provided and editor messages, rejection, and --no-hooks.
@sensei-woo
sensei-woo marked this pull request as ready for review August 9, 2026 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant