Giter Site home page Giter Site logo

Comments (7)

pfraces-ob avatar pfraces-ob commented on August 20, 2024 1

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.

stephenlacy avatar stephenlacy commented on August 20, 2024

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.

loveencounterflow avatar loveencounterflow commented on August 20, 2024

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.

stephenlacy avatar stephenlacy commented on August 20, 2024

PR Welcome.

from gulp-git.

loveencounterflow avatar loveencounterflow commented on August 20, 2024

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.

stringparser avatar stringparser commented on August 20, 2024

@loveencounterflow was { maxBuffer: Infinity } the solution?

from gulp-git.

stephenlacy avatar stephenlacy commented on August 20, 2024

I'll add the alteration if it is determined that the Infinity will fix it.

from gulp-git.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.