<commit_before>/**
 * When a commit message contains "release v" followed by a version number
 * (major.minor.patch) a tagged release will be issued
 * 
 * @param grunt
 *            the grunt instance
 * @param src
 *            the source directory (default: CWD)
 * @param destBranch
 *            the origin (default: gh-pages)
 * @param destDir
 *            the directory to subtree (default: dist)
 * @param chgLog
 *            the optional change log file name to generate (default:
 *            HISTORY.md)
 * @param authors
 *            the optional authors file name to generate (default: AUTHORS.md)
 */
module.exports = function(grunt, src, destBranch, destDir, chgLog, authors) {
	'use strict';

	src = src || process.cwd();
	destBranch = destBranch || 'gh-pages';
	destDir = destDir || 'dist';
	chgLog = chgLog || 'HISTORY.md';
	authors = authors || 'AUTHORS.md';

	var shell = require('shelljs');
	var releaseVer = '';
	var chgLogRtn = '';
	var authorsRtn = '';

	// Capture commit message
	var commitMsg = process.env.TRAVIS_COMMIT_MESSAGE;
	if (!commitMsg) {
		commitMsg = runCmd("git show -s --format=%B "
				+ process.env.TRAVIS_COMMIT + " | tr -d '\\n'");
		if (!commitMsg) {
			grunt.log.error('Error capturing commit message for '
					+ process.env.TRAVIS_COMMIT);
			return done(false);
		}
	}
	grunt.log.writeln('Commit message: ' + commitMsg);
	releaseVer = extractCommitMsgVer(commitMsg, true);
	if (!releaseVer) {
		return done(false);
	}
	// TODO : verify commit message release version is less than
	// current version using "git describe --abbrev=0 --tags"
	grunt.log.writeln('Preparing release: ' + v);

	// Generate change log for release using all messages since last
	// tag/release
	chgLogRtn = runCmd(
			'git log `git describe --tags --abbrev=0`..HEAD --pretty=format:"  * %s"',
			chgLog, true);

	// Generate list of authors/contributors since last tag/release
	authorsRtn = runCmd('git log --all --format="%aN <%aE>" | sort -u', authors);

	// Commit local release destination changes
	if (runCmd('git add --all ' + destDir + ' && git commit -m "' + commitMsg
			+ '"') === undefined) {
		return;
	}

	// Push release changes<commit_msg>Release v1.0.0-beta.4<commit_after>/**
 * When a commit message contains "release v" followed by a version number
 * (major.minor.patch) a tagged release will be issued
 * 
 * @param grunt
 *            the grunt instance
 * @param src
 *            the source directory (default: CWD)
 * @param destBranch
 *            the origin (default: gh-pages)
 * @param destDir
 *            the directory to subtree (default: dist)
 * @param chgLog
 *            the optional change log file name to generate (default:
 *            HISTORY.md)
 * @param authors
 *            the optional authors file name to generate (default: AUTHORS.md)
 */
module.exports = function(grunt, src, destBranch, destDir, chgLog, authors) {
	'use strict';

	src = src || process.cwd();
	destBranch = destBranch || 'gh-pages';
	destDir = destDir || 'dist';
	chgLog = chgLog || 'HISTORY.md';
	authors = authors || 'AUTHORS.md';

	var shell = require('shelljs');
	var releaseVer = '';
	var chgLogRtn = '';
	var authorsRtn = '';

	// Capture commit message
	var commitMsg = process.env.TRAVIS_COMMIT_MESSAGE;
	if (!commitMsg) {
		commitMsg = runCmd("git show -s --format=%B "
				+ process.env.TRAVIS_COMMIT + " | tr -d '\\n'");
		if (!commitMsg) {
			grunt.log.error('Error capturing commit message for '
					+ process.env.TRAVIS_COMMIT);
			return;
		}
	}
	grunt.log.writeln('Commit message: ' + commitMsg);
	releaseVer = extractCommitMsgVer(commitMsg, true);
	if (!releaseVer) {
		return;
	}
	// TODO : verify commit message release version is less than
	// current version using "git describe --abbrev=0 --tags"
	grunt.log.writeln('Preparing release: ' + releaseVer);

	// Generate change log for release using all messages since last
	// tag/release
	chgLogRtn = runCmd(
			'git log `git describe --tags --abbrev=0`..HEAD --pretty=format:"  * %s"',
			chgLog, true);

	// Generate list of authors/contributors since last tag/release
	authorsRtn = runCmd('git log --all --format="%aN <%aE>" | sort -u', authors);

	// Commit local release destination changes
	if (runCmd('git add --all ' + destDir + ' && git commit -m "' + commitMsg
			+ '"') === undefined) {
		return;
	}

	// Push release changes
{'fraction_non_alphanumeric': 0.13718742830924524, 'fraction_numerical': 0.0018352833218628125, 'mean_word_length': 3.0823970037453186, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1512755', 'n_tokens_mistral': 1458, 'n_tokens_neox': 1391, 'n_words': 430}