stevelacy/gulp-git — pull request #16 by ngConsulti (2014-04-15 03:42:17+00:00)
Title: Two git commands made "stream aware": commit & push

This PR is submitted for discussion and aims to address [#14](https://github.com/stevelacy/gulp-git/issues/14). It is NOT complete or ready for merging.

Here are the highlights:
- By using `spawn` instead of `exec`, the command output can be streamed instead of buffered. Very useful when watching a push to Heroku or similar.
- By using the second param of `through.obj()` with a callback, execution does not advance to the next stage of the pipeline until the command returns.

The result is that `add`, `commit`, and `push` can all be chained in a single task.

Example:
```javascript
var cwd = "" + process.cwd() + "/dist/" + target;
gulp.src('./', {cwd: cwd, read: false})
.pipe( git.add({args: '--all'}) )
.pipe( git.commit("Deploy: " + target) )
.on('error', gutil.beep)
.pipe( git.push('dokku.dev', 'master', {cwd: cwd}) )
.on('error', gutil.beep);
```