Skip to content

fix: answer git var for a squash message instead of logging it as unknown - #8

Merged
shenxianpeng merged 1 commit into
mainfrom
fix/merge-author
Nov 25, 2026
Merged

shenxianpeng merged 1 commit into
mainfrom
fix/merge-author

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Found on the first real squash merge (pipe-test PR 4, message bad message). The on-merge check gave the right verdict, but the log also had a warning:

Before

WARN  commit-check asked git what this app cannot answer: git var GIT_AUTHOR_IDENT
INFO  Merge check {…}#4 (on-merge): fail (CC001)

For a message that is not committed yet, the CLI asks git var GIT_AUTHOR_IDENT who the commit will be by. For a squash merge that is whoever presses Merge, and Bitbucket does not say: the merge check event carries only the workspace, repository, pull request, trigger and merge properties.

After: the shim answers git var GIT_AUTHOR_IDENT and GIT_COMMITTER_IDENT as git does with no identity configured (fatal: unable to auto-detect email address). The verdict is the same as before; the warning is gone, so the warning stays meaningful for git commands that really are unknown.

A new test runs the squash path (.commit-check-message -m -n -e -b, ai_attribution = "forbid"). It expects no unknown git commands, CC001 to fail, and CC017 (AI author) not to fail. Without the fix it fails with unsupported: ['git var GIT_AUTHOR_IDENT'].

164 tests pass, coverage 100%, lint clean.

@shenxianpeng
shenxianpeng merged commit b423449 into main Nov 25, 2026
2 checks passed
@shenxianpeng
shenxianpeng deleted the fix/merge-author branch November 25, 2026 21:51
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