You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Diff a Merge Commit Against MERGE_HEAD in the pre-commit Framework Snippet's Prose Gate #4131
catalog/snippets/pre-commit/.pre-commit-config.yaml runs the prose gate with --diff HEAD. During a merge, the pre-commit framework passes the gate the conflicted files and the files the resolution changes. A comment line the merged-in parent brought into such a file then reads as added against HEAD, and comment-added refuses the merge commit.
This is the class #4104 fixes in catalog/snippets/husky/pre-commit, which now diffs a merge commit against MERGE_HEAD, as the hub's own .husky/pre-commit already did. The framework config could not take the same fix in that change. Its entry is a command line rather than a shell script, so choosing the base there needs a shell wrapper whose behavior under Git for Windows was not verified.
Constructed case
On develop, commit conflict.py holding VALUE = "base" below a few blank lines.
Branch feature, and change the value to "feature".
On develop, change it to "develop" and add a comment line at the top of the file.
On feature, with the config's prose-gate hook installed, run git merge develop. It conflicts on the value.
Resolve the value, keep develop's comment line, stage, and run git commit --no-edit.
The hook prints Checking merge-conflict files only. and refuses the commit with conflict.py:1: comment-added, although the merge adds no comment of its own. Run against the hub at fa06887f.
Expected
On a merge commit the gate diffs against MERGE_HEAD, as both Husky.Net hooks now do. One shape that also serves the Husky.Net hooks is for prose_lint.py to choose that base itself, for example a --diff value meaning HEAD, or MERGE_HEAD while a merge is in progress. The two hook files would then drop their duplicated base choice. That consolidation was raised by the local review of the pull request fixing #4104.
Found by
The local strict review of the pull request fixing #4122, #4104 and #4121, confirmed by the constructed case above.
Activity
Read the Husky Hook's Path List Once, Diff a Merge Against MERGE_HEAD…
ptr727 commentedon Nov 13, 2026
Backlog burndown claim, round 2 (2026-11-13), away run, scope
develop. Branchburndown/hook-chain-gate, group: #4131, #4135, #4123, #4108. Tier:frontier(carried hook snippets and helper, the prose gate, entangled across one hook chain).Predicted files:
.github/actions/prose-gate/prose_lint.py.github/actions/prose-gate/prose-gate.jsonscripts/prose_lint.pytests/test_prose_lint.pycatalog/snippets/pre-commit/.pre-commit-config.yamlcatalog/snippets/pre-commit/README.mdcatalog/snippets/husky/pre-commitcatalog/snippets/husky/README.md.husky/pre-commit.husky/pre-pushcatalog/snippets/hub_fetch_run.pytests/test_hub_fetch_run.pytests/test_pre_commit_hook.pyscripts/README.mdGOVERNANCE.md("Running the Linters Locally (Known-Working Invocations)", the hook's diff-base sentence)Let the Prose Gate Choose a Commit's Diff Base, Pair Code Spans as Ma…