FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bin: use --no-mailmap when loading commits by mcollina · Pull Request #148 · nodejs/core-validate-commit · GitHub

bin: use --no-mailmap when loading commits - #148

Open
mcollina wants to merge 1 commit into
mainfrom
fix-no-mailmap-signedoff
Open

bin: use --no-mailmap when loading commits#148
mcollina wants to merge 1 commit into
mainfrom
fix-no-mailmap-signedoff

Conversation

mcollina commented May 2, 2026

Copy link
Copy Markdown
Member

Summary

  • load commits with git show --no-mailmap so validation uses the raw commit author
  • avoid false Signed-off-by mismatch warnings caused by .mailmap rewriting
  • add a CLI regression test covering a mailmapped author/sign-off pair

Testing

  • node test/cli-test.js
  • npm test

Signed-off-by: Matteo Collina <hello@matteocollina.com>
mcollina requested a review from aduh95 May 28, 2026 15:20
Comment thread test/cli-test.js
Comment on lines +401 to +410
const defaultShow = git(repoDir, ['show', '--quiet', '--format=medium', 'HEAD'])
const rawShow = git(repoDir, ['show', '--no-mailmap', '--quiet', '--format=medium', 'HEAD'])

tt.match(defaultShow,
/Author:\s+Matteo Collina <matteo\.collina@gmail\.com>/,
'git show applies mailmap by default')
tt.match(rawShow,
/Author:\s+Matteo Collina <hello@matteocollina\.com>/,
'git show --no-mailmap preserves the raw author email')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This would make the test fail for unrelated reasons (e.g if the git global config disables mailmaps)

Comment thread test/cli-test.js
Comment on lines +377 to +387
const repoDir = mkdtempSync(join(tmpdir(), 'core-validate-commit-'))
const env = {
GIT_AUTHOR_NAME: 'Matteo Collina',
GIT_AUTHOR_EMAIL: 'hello@matteocollina.com',
GIT_COMMITTER_NAME: 'Matteo Collina',
GIT_COMMITTER_EMAIL: 'hello@matteocollina.com'
}

git(repoDir, ['init', '-b', 'main'])
git(repoDir, ['config', 'user.name', 'Test User'])
git(repoDir, ['config', 'user.email', 'test@example.com'])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Can we instead use this repo like is done for the other tests?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL