Created
February 20, 2014 20:47
-
-
Save MothOnMars/9122895 to your computer and use it in GitHub Desktop.
spec for git commit message format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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