{"action":"opened","issue":{"url":"https://api.github.com/repos/bahmutov/pre-git/issues/46","labels_url":"https://api.github.com/repos/bahmutov/pre-git/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/bahmutov/pre-git/issues/46/comments","events_url":"https://api.github.com/repos/bahmutov/pre-git/issues/46/events","html_url":"https://github.com/bahmutov/pre-git/issues/46","id":118442554,"number":46,"title":"stdout maxBuffer exceeded when running pre-push hook","user":{"login":"carlosvillademor","id":615092,"avatar_url":"https://avatars.githubusercontent.com/u/615092?v=3","gravatar_id":"","url":"https://api.github.com/users/carlosvillademor","html_url":"https://github.com/carlosvillademor","followers_url":"https://api.github.com/users/carlosvillademor/followers","following_url":"https://api.github.com/users/carlosvillademor/following{/other_user}","gists_url":"https://api.github.com/users/carlosvillademor/gists{/gist_id}","starred_url":"https://api.github.com/users/carlosvillademor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlosvillademor/subscriptions","organizations_url":"https://api.github.com/users/carlosvillademor/orgs","repos_url":"https://api.github.com/users/carlosvillademor/repos","events_url":"https://api.github.com/users/carlosvillademor/events{/privacy}","received_events_url":"https://api.github.com/users/carlosvillademor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-23T18:29:45Z","updated_at":"2015-11-23T18:29:45Z","closed_at":null,"body":"Hi Gleb,\r\n\r\nI am using your library to create hooks for git. Kudos for the good work. I am getting an error though:\r\n\r\n```pre-push Failed to check for commits. Cannot run the tests.```\r\n```pre-push [Error: stdout maxBuffer exceeded.]```\r\n\r\nI 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.\r\n\r\nI have verified that the command is causing trouble is\r\n\r\n```git diff --name-only origin/master..HEAD```\r\n\r\nI 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?"}}