Skip to content

Instantly share code, notes, and snippets.

@MothOnMars
Created February 20, 2014 20:47
Show Gist options
  • Save MothOnMars/9122895 to your computer and use it in GitHub Desktop.
Save MothOnMars/9122895 to your computer and use it in GitHub Desktop.
spec for git commit message format
describe 'git process' do
describe 'commit message' do
it 'includes the Pivotal Tracker story id' do
includes_properly_formatted_pt_id?.should be_true
end
def includes_properly_formatted_pt_id?
# [Fixes #1234555] for individual stories
# [Fixes #1234555 #928756] if the fix affects multiple stories
last_commit_message = %x{git log -1 --pretty=%B --no-merges}
!(last_commit_message !~/\[Fixes( #[0-9]+)+\]/)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment