Comments (7)
Indeed, {maxBuffer: Infinity }
solves the issue. The setting can be passed to gulp-git
methods through the options object:
gulp.task('commit', function () {
gulp.src('src/')
.pipe(git.add({ args: '--all', maxBuffer: Infinity }))
.pipe(git.commit('auto-generated commit', { maxBuffer: Infinity }));
});
from gulp-git.
It is a node child_process.exec
buffer error.
The amount of data flowing through stdout is larger than the max default value.
It can be changed in gulp-git
from gulp-git.
Where and how can i change this limitation in gulp-git
?
IMHO it is a known fact that the buffer size of child_process.exec
is limited. Also, we know that when git gets to process a lot of files, it also spits out a lot of messages. I think it's a flaw in the gulp-git
implementation that this data is not altogether silently discarded but complains when exceeding a certain limit; this makes workflows susceptible to hard-to-detect bugs that will crop up only if a given git step has to process that one file entry, that one line of discardable output that exceeds an arbitrary limit.
http://www.hacksparrow.com/difference-between-spawn-and-exec-of-node-js-child_process.html puts it well:
child_process.exec returns the whole buffer output from the child process. By default the buffer size is set at 200k. If the child process returns anything more than that, you program will crash with the error message "Error: maxBuffer exceeded". You can fix that problem by setting a bigger buffer size in the exec options. But you should not do it because exec is not meant for processes that return HUGE buffers to Node. You should use spawn for that. So what do you use exec for? Use it to run programs that return result statuses, instead of data.
Any reason to use child_process.exec
instead of child_process.spawn
at all? gulp is inherently asynchronous, and so should be gulp plugins. Just my 2 cents.
from gulp-git.
PR Welcome.
from gulp-git.
So i researched a bit into this, and apart from the fact that spawn
takes a command and an array of options where exec
expects a single string as written on the command line, spawn
executes a command directly whereas exec
uses the shell, meaning that metacharacters and variables will get expanded. This would seem to entail that if there was a drop-in replacement for exec
that underneath uses spawn
(but otherwise tries to accept arguments and call the callback as exec
does) would still need to deal with shell expansion issues. Without shell expansions, we should expect some changes in behavior.
That said, exec
accepts as second argument an options object where maxBuffer
may be set. I haven't tried yet but { maxBuffer: Infinity }
should remove the buffer error.
from gulp-git.
@loveencounterflow was { maxBuffer: Infinity }
the solution?
from gulp-git.
I'll add the alteration if it is determined that the Infinity will fix it.
from gulp-git.
Related Issues (20)
- Get current branch name? HOT 2
- git add is broken in Node 8 HOT 1
- git.add does not allow for specified files to add in another cwd HOT 4
- gulp-git breaks in Node 9.5.0. HOT 3
- Error creating commit on new git version HOT 20
- Error: i can't commit HOT 2
- How to use git clone with ssh HOT 2
- How to clone with a specified branch? HOT 5
- commit() will commit also unstaged files HOT 2
- Git add . all files HOT 2
- Cannot use '-a' anymore for commit HOT 4
- how can I checkout a file HOT 1
- stdout maxBuffer length exceeded (diff.js) HOT 1
- Problem with absolute path or Gulp v4
- Cherry-pick - feature request HOT 1
- finish event listener registration error
- Gulp 4 compatibility HOT 1
- Add rebase command HOT 2
- "The command line is too long." on `git.add()` HOT 1
- lodash.template critical vulnerabilities from Mend HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gulp-git.