public function get_change_id($commit_hash) { $show = $this->shell->shell_exec($this->git . ' show -s --no-color ' . $commit_hash); $matches = array(); preg_match("/.*Change-Id: ([Ia-z0-9]*)/", $show, $matches); if (count($matches) === 0) { throw new GitException("No Change-Id in commit message for {$commit_hash}"); } return $matches[1]; }