Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stdout maxBuffer exceeded when running pre-push hook #46

Open
carlosvillademor opened this issue Nov 23, 2015 · 0 comments
Open

stdout maxBuffer exceeded when running pre-push hook #46

carlosvillademor opened this issue Nov 23, 2015 · 0 comments

Comments

@carlosvillademor
Copy link

Hi Gleb,

I am using your library to create hooks for git. Kudos for the good work. I am getting an error though:

pre-push Failed to check for commits. Cannot run the tests.
pre-push [Error: stdout maxBuffer exceeded.]

I think this is due to the limitation of the stdout maxBuffer that Nodejs defaults to 200KB, see https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback.

I have verified that the command is causing trouble is

git diff --name-only origin/master..HEAD

I committed by mistake my node_modules folder and now I want to remove it from my repository. Obviously, the list of files is big and the command above produces a lot of text. I could increase the maxBuffer but I have read the article on http://www.hacksparrow.com/difference-between-spawn-and-exec-of-node-js-child_process.html that does not recommend to do that. What do you think? Do you have anything against using spawn rather than exec to create the child process?

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

No branches or pull requests

1 participant