0.1.0 • Published 10 years ago

gulp-git-watch v0.1.0

Weekly downloads
19
License
MIT
Repository
github
Last release
10 years ago

Gulp-Git-Watch

Gulp utility to constantly check Git for updates and trigger events when detected.

var gulp = require('gulp');
var gitWatch = require('gulp-git-watch');

gulp.task('git-watch', function() {
	gitWatch()
		.on('check', function() {
			console.log('CHECK!');
		})
		.on('change', function(newHash, oldHash) {
			console.log('CHANGES! FROM', oldHash, '->', newHash);
		});
});

Options

OptionDefaultDescription
poll10 * 1000 - 10sHow often gulp-git-watch should poll Git for changes
initialPoll10 * 1000 - 10sHow long gulp-git-watch should wait after the initial starting point to start polling
headnullThe initial Git HEAD value, if omitted it will be retrieved before polling
forceHeadfalseForce always re-retrieving the current head state, only set this if other processes are likely to be triggering git pull events
gitHeadgit rev-list HEAD -n 1The command to use to retrieve the current Git HEAD
gitPullgit pullThe command to use to instruct Git to pull in changes

Events

EventDescription
check()Triggered when gulp-git-watch polls Git for changes
change(newHash, oldHash)Triggered when Git has updated from the old hash to a new hash
nochange(hash)Triggered when no Git changes were found