<commit_before><?php
/**
 * Golem_Cli_Command_Feature
 * Start and finish a new feature.
 * Basically a wrapper around git flow and semver.
 *
 * @author       <NAME> | grrr.nl
 * @version      0.0.1
 * @package      Golem_Cli_Command_Feature
 */
class Golem_Cli_Command_Feature extends Golem_Cli_Command_Flow {

	public function start($args) {
		if (empty($args[0])) {
			Garp_Cli::errorOut('No feature given. Do you want me to come up with a new feature myself?');
			Garp_Cli::errorOut('(I suggest making me self-aware)');
			return false;
		}
		$feature = $args[0];
		$git_flow_feature_start_cmd = 'git flow feature start ' . $feature;
		$this->_exec_cmd($git_flow_feature_start_cmd);
		return true;
	}

	public function finish($args) {
		$branch = $this->_get_current_branch();
		$prefix = $this->_get_gitflow_prefix('feature');

		if (!preg_match('~^' . preg_quote($prefix) . '~', $branch)) {
			Garp_Cli::errorOut('You are not currently on a feature branch.');
			return false;
		}

		$curr_feature = preg_replace('~^' . preg_quote($prefix) . '~', '', $branch);
		$git_flow_feature_end_cmd = 'git flow feature finish ' . $curr_feature;
		passthru($git_flow_feature_end_cmd);
		return true;
	}

	public function publish($args) {
		$branch = $this->_get_current_branch();
		$prefix = $this->_get_gitflow_prefix('feature');

		if (!preg_match('~^' . preg_quote($prefix) . '~', $branch)) {
			Garp_Cli::errorOut('You are not currently on a feature branch.');
			return false;
		}

		$curr_feature = preg_replace('~^' . preg_quote($prefix) . '~', '', $branch);
		$git_flow_feature_publish_cmd = 'git flow feature publish ' . $curr_feature;
		passthru($git_flow_feature_publish_cmd);
		return true;
	}

	public function track($args) {
		return $this->trackFeature($args);
	}

	public function help() {
		Garp_Cli::lineOut('Usage:');
		Garp_Cli::lineOut(' g feature start discombobulator', Garp_Cli::BLUE);
		Garp_Cli::lineOut(' g feature finish', Garp_Cli::BLUE);
		Garp_Cli::lineOut(' g feature publish', Garp_Cli::BLUE);
		Garp_Cli::lineOut(' g feature track discombobulator', Garp_Cli::BLUE);
		Garp_Cli::lineOut('Note: this requires the git flow and semver commandline utilities.');
	}

}
<commit_msg>Added git flow feature track wrapper<commit_after><?php
/**
 * Golem_Cli_Command_Feature
 * Start and finish a new feature.
 * Basically a wrapper around git flow and semver.
 *
 * @author       <NAME> | grrr.nl
 * @version      0.0.1
 * @package      Golem_Cli_Command_Feature
 */
class Golem_Cli_Command_Feature extends Golem_Cli_Command_Flow {

	public function start($args) {
		if (empty($args[0])) {
			Garp_Cli::errorOut('No feature given. Do you want me to come up with a new feature myself?');
			Garp_Cli::errorOut('(I suggest making me self-aware)');
			return false;
		}
		$feature = $args[0];
		$git_flow_feature_start_cmd = 'git flow feature start ' . $feature;
		$this->_exec_cmd($git_flow_feature_start_cmd);
		return true;
	}

	public function finish($args) {
		$branch = $this->_get_current_branch();
		$prefix = $this->_get_gitflow_prefix('feature');

		if (!preg_match('~^' . preg_quote($prefix) . '~', $branch)) {
			Garp_Cli::errorOut('You are not currently on a feature branch.');
			return false;
		}

		$curr_feature = preg_replace('~^' . preg_quote($prefix) . '~', '', $branch);
		$git_flow_feature_end_cmd = 'git flow feature finish ' . $curr_feature;
		passthru($git_flow_feature_end_cmd);
		return true;
	}

	public function publish($args) {
		$branch = $this->_get_current_branch();
		$prefix = $this->_get_gitflow_prefix('feature');

		if (!preg_match('~^' . preg_quote($prefix) . '~', $branch)) {
			Garp_Cli::errorOut('You are not currently on a feature branch.');
			return false;
		}

		$curr_feature = preg_replace('~^' . preg_quote($prefix) . '~', '', $branch);
		$git_flow_feature_publish_cmd = 'git flow feature publish ' . $curr_feature;
		passthru($git_flow_feature_publish_cmd);
		return true;
	}

	public function track($args) {
		if (empty($args)) {
			Garp_Cli::errorOut('No feature name provided.');
			return false;
		}
		$branch = $args[0];
		$git_flow_feature_publish_cmd = 'git flow feature track ' . $branch;
		passthru($git_flow_feature_publish_cmd);
		return true;
	}

	public function help() {
		Garp_Cli::lineOut('Usage:');
		Garp_Cli::lineOut(' g feature start discombobulator', Garp_Cli::BLUE);
		Garp_Cli::lineOut(' g feature finish', Garp_Cli::BLUE);
		Garp_Cli::lineOut(' g feature publish', Garp_Cli::BLUE);
		Garp_Cli::lineOut(' g feature track discombobulator', Garp_Cli::BLUE);
		Garp_Cli::lineOut('Note: this requires the git flow and semver commandline utilities.');
	}

}

{'fraction_non_alphanumeric': 0.1487941429801895, 'fraction_numerical': 0.0023686477174849267, 'mean_word_length': 4.7063882063882065, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 16, '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': '6328849', 'n_tokens_mistral': 1752, 'n_tokens_neox': 1598, 'n_words': 370}