stevelacy/gulp-git — pull request #58 by stewartml (2014-12-12 13:19:20+00:00)
Title: Add support for gulp-data

It would be handy to be able to pipe in options, such as commit messages, using [gulp-data](https://www.npmjs.com/package/gulp-data).

This would permit the following task for tagging versions:

```js
var gulp = require('gulp');
var bump = require('gulp-bump');
var git = require('gulp-git');
var data = require('gulp-data');

gulp.task('tag', function () {
var version;

//pipe the package.json through gulp-bump and save it
return gulp.src('./package.json')
.pipe(bump())
.pipe(gulp.dest('./'))
.pipe(data(function (file) {
//parse the package.json and get the version number
version = JSON.parse(file.contents.toString()).version;
//construct the commit message from the version number
return {message: 'Version ' + version};
}))
//git.commit will get the commit message from the gulp-data function above
.pipe(git.commit())
.on('end', function () {
//tag the new version
git.tag('v' + version, 'Version ' + version, function (err) {
if (err) throw err;
});
});
});
```

Thanks!