Merged
Conversation
Moved the coerceToBuffer import from './core' to './coerce-to-buffer' for better module separation and clarity.
Added 'GITHEAD_' to the list of safe environment variable prefixes passed to hooks, alongside 'GIT_'. This ensures variables set by git-merge are included unless explicitly excluded.
Closed
sergiou87
approved these changes
Feb 3, 2026
Member
sergiou87
left a comment
There was a problem hiding this comment.
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 💪
![]()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #[issue number]
Description
Based on #21486, please review that first.
This adds support for intercepting the
pre-merge-commithook as well as commit-related hooks when callinggit mergeandgit 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 mergefollowed bygit 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: