Open
Description
Steps to Reproduce
We are running the following command: commitlint --from=HEAD^1
. This works fine on OSX, but fails in Windows 10 (cmd.exe) with the following error:
/node_modules/@commitlint/cli/lib/cli.js:127
throw err;
^
Error: fatal: ambiguous argument 'HEAD1..HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
at Transform.transform [as _transform] (C:\CODE\instructure-ui\node_modules\git-raw-commits\index.js:100:36)
at Transform._write (node:internal/streams/transform:171:8)
at writeOrBuffer (node:internal/streams/writable:570:12)
at _write (node:internal/streams/writable:499:10)
at Writable.write (node:internal/streams/writable:508:10)
at Socket.ondata (node:internal/streams/readable:1007:22)
at Socket.emit (node:events:532:35)
at addChunk (node:internal/streams/readable:559:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
at Readable.push (node:internal/streams/readable:390:5)
Node version: 22
commitlint.config.js:
module.exports = {
extends: ['@commitlint/config-conventional'],
parserOpts: {
headerPattern: /^(\w*)\((\w*)\)-(\w*)\s(.*)$/,
headerCorrespondence: ['type', 'scope', 'subject']
},
// see https://commitlint.js.org/#/reference-rules
rules: {
'type-enum': [
2,
'always',
[
'WIP',
'feat',
'fix',
'docs',
'chore',
'style',
'refactor',
'test',
'perf',
'revert'
]
],
'type-case': [0],
'header-max-length': [0, 'always', 150] // commit message first field (subject) length
}
}
versions:
"@commitlint/cli": "19.3.0",
"@commitlint/config-conventional": "19.2.2",
(was producing the same error on v17)
running via Husky
### Current Behavior
crash
### Expected Behavior
no crash
### Affected packages
- [X] cli
- [ ] core
- [ ] prompt
- [ ] config-angular
### Possible Solution
_No response_
### Context
_No response_
### commitlint --version
19.3.0
### git --version
2.45.2.windows.1
### node --version
v22.5.1