qoomon / git-conventional-commits

Git Conventional Commits Util to generate Semantic Version and Markdown Change Log and Validate Commit Messag
https://short.qoo.monster/Conventional-Commits
GNU General Public License v3.0
379 stars 40 forks source link

RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stdout maxBuffer length exceeded #149

Closed davhdavh closed 1 year ago

davhdavh commented 1 year ago

git-conventional-commits changelog

RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stdout maxBuffer length exceeded
    at new NodeError (node:internal/errors:406:5)
    at Socket.onChildStdout (node:child_process:490:14)
    at Socket.emit (node:events:514:28)
    at addChunk (node:internal/streams/readable:376:12)
    at readableAddChunk (node:internal/streams/readable:345:11)
    at Readable.push (node:internal/streams/readable:286:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23) {
  code: 'ERR_CHILD_PROCESS_STDIO_MAXBUFFER',
  cmd: 'git log --reverse --format=%H===LOG_FIELD_SEPARATOR===%aI===LOG_FIELD_SEPARATOR===%s===LOG_FIELD_SEPARATOR===%b===LOG_COMMIT_DELIMITER=== master'
}

Thinking it might be choking on the 50000 commits this repo has, I also tried with --commit some_recent_hash, but same result.

Thinking it might be a windows issue, I tried wsl:

/mnt/c/Users/davh/AppData/Roaming/npm/node_modules/git-conventional-commits/node_modules/yaml/dist/compose/composer.js:33
                if (prelude[i + 1]?.[0] !== '#')
                                   ^

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/mnt/c/Users/davh/AppData/Roaming/npm/node_modules/git-conventional-commits/node_modules/yaml/dist/index.js:3:16)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

Ok, perhaps a wsl/npm issue, lets install it into wsl:

$ sudo npm install -g git-conventional-commits
$ node /usr/local/lib/node_modules/git-conventional-commits/cli.js
/usr/local/lib/node_modules/git-conventional-commits/node_modules/yaml/dist/compose/composer.js:33
                if (prelude[i + 1]?.[0] !== '#')
                                   ^

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/git-conventional-commits/node_modules/yaml/dist/index.js:3:16)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

So probably a node-12 issue, lets fix that.

$ find magic nvm tool && nvm install --lts
$ node /usr/local/lib/node_modules/git-conventional-commits/cli.js changelog
RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stdout maxBuffer length exceeded
    at new NodeError (node:internal/errors:405:5)
    at Socket.onChildStdout (node:child_process:490:14)
    at Socket.emit (node:events:517:28)
    at addChunk (node:internal/streams/readable:335:12)
    at readableAddChunk (node:internal/streams/readable:304:11)
    at Readable.push (node:internal/streams/readable:245:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23) {
  code: 'ERR_CHILD_PROCESS_STDIO_MAXBUFFER',
  cmd: 'git log --reverse --format=%H===LOG_FIELD_SEPARATOR===%aI===LOG_FIELD_SEPARATOR===%s===LOG_FIELD_SEPARATOR===%b===LOG_COMMIT_DELIMITER=== HEAD'
}

Config is just whatever init made.

I did have to change .git/hooks/commit-msg to use git-conventional-commits.ps1 instead of just git-conventional-commits because it wouldn't work when calling it from inside visual studio. cygpath - command not found

I'm out of ideas how to make this work 😢

davhdavh commented 1 year ago

ahh, it is chooking on the number of commits. If I pick some commit from 15 years ago it works - ish...

This output is pretty useless:

$ git-conventional-commits changelog -r v0.0.1 --commit 0fa5d0bc1b16821b111364e67af240f0cc35ef8d
[WARN] 3c8e650 - Invalid commit subject format: 'New repository initialized by cvs2svn.'
[WARN] 2251d1c - Invalid commit subject format: 'no message'
[WARN] f4d44ba - Invalid commit subject format: 'no message'
[WARN] e0d0595 - Invalid commit subject format: 'no message'
[WARN] f8b4f84 - Invalid commit subject format: 'no message'
[WARN] 6bcf945 - Invalid commit subject format: 'Made it readable'
[WARN] 0534267 - Invalid commit subject format: '*** empty log message ***'
[WARN] cd202c0 - Invalid commit subject format: 'no message'
[WARN] 9949a23 - Invalid commit subject format: 'no message'
[WARN] fa82c8a - Invalid commit subject format: 'no message'
[WARN] 9ee9227 - Invalid commit subject format: 'no message'
[WARN] e9cb4cd - Invalid commit subject format: 'no message'
[WARN] d2e96ca - Invalid commit subject format: 'Add new column on Data table (for Thomas)'
[WARN] a677b34 - Invalid commit subject format: 'no message'
[WARN] 3da46ae - Invalid commit subject format: 'no message'
[WARN] cae0a2c - Invalid commit subject format: 'no message'
[WARN] a870259 - Invalid commit subject format: 'no message'
[WARN] 0fa5d0b - Invalid commit subject format: 'no message'
## **v0.0.1**&emsp;<sub><sup>2006-03-14 (3c8e650e92e145768101dc39e525012d670968e9...0fa5d0bc1b16821b111364e67af240f0cc35ef8d)</sup></sub>

### ? ? ?

- New repository initialized by cvs2svn\. (3c8e650e92e145768101dc39e525012d670968e9)
- no message (2251d1c1d29d60519947623c4affea8bd579bfd1)
- no message (f4d44ba51ef96b007196a6fed40ce39a7b8ee38f)
- no message (e0d0595d67e00d462d70ac834163232c6a7772c8)
- no message (f8b4f84d588e8d0293da5db5d7e029b33e8496c8)
- Made it readable (6bcf94531b2680ec899b7da7cab3c6907e96a5d8)
- \*\*\* empty log message \*\*\* (0534267a8545c26f22f5a4f736046ca393d39287)
- no message (cd202c04038377fd5468b73ebfb92a335416b392)
- no message (9949a230dbc7ca982eb5b2d34ea2014194e07f4c)
- no message (fa82c8aab9aea22e13776150949e00015438a8a5)
- no message (9ee9227cb5c94c2df7ebb8cfc9d0ab93c91d5182)
- no message (e9cb4cd1bde162e3a288d303c2503bba9a3f147c)
- Add new column on Data table \(for Thomas\) (d2e96cac587806273186d0f27a11809097120ca6)
- no message (a677b341351f5542723a78cd1562e84ec2c2c64b)
- no message (3da46aec0a95152683dea0976e495b97a0d050e7)
- no message (cae0a2cd7dbb82f39a56f83114054679c5150773)
- no message (a8702592218e83f293ecdcea36a9fa212a55e9af)
- no message (0fa5d0bc1b16821b111364e67af240f0cc35ef8d)

<br>

How can I limit it to just look at commits made AFTER we convert to conventional commits?

qoomon commented 1 year ago

Hi @davhdavh, did you manage to make it work?