Skip to content

Support merge hooks - #21502

Merged
niik merged 14 commits into
developmentfrom
merge-hooks
Feb 3, 2026
Merged

niik merged 14 commits into
developmentfrom
merge-hooks

Conversation

@niik

@niik niik commented Jan 22, 2026

Copy link
Copy Markdown
Member

Closes #[issue number]

Description

Based on #21486, please review that first.

This adds support for intercepting the pre-merge-commit hook as well as commit-related hooks when calling git merge and git merge --squash.

This looks a little bit more complicated than #21486 and #21461 because I had to do a bit of refactoring to be able to support streaming output from two Git commands (our squash merges end up calling git merge followed by git commit). Note however that this logic isn't actually being used at the moment. No one subscribes to terminal output for merges so it's not super critical but given that it's not being used I did add a few tests to make sure the implementation was sound because we will need it in the future (if not for merge then for something else).

Screenshots

Release notes

Notes:

@niik niik mentioned this pull request Jan 22, 2026
Base automatically changed from pull-hooks to development January 30, 2026 10:49

@sergiou87 sergiou87 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM and worked as expected! Not sure if I tested all cases though, but I was able to trigger the hook in several scenarios 💪

:shipit:

@niik
niik merged commit a5c6605 into development Feb 3, 2026
@niik
niik deleted the merge-hooks branch February 3, 2026 11:07
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.

2 participants