Skip to content

Simple git commit-msg hook to ensure Jira issue numbers are part of the commit message.

License

Notifications You must be signed in to change notification settings

drdk/git-commit-msg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-commit-msg

Simple git commit-msg hook to ensure that commit messages contain Jira issue id's

Requirements

  • Python 2.6

Installation

Copy the following files to the .git/hook directory in the repository you are going to use the commit-msg hook.

commit-msg
jira-commit-msg.py

Both files have to be executables.

chmod +x filename

Naming standard

Currently the naming standard is based on a simple regex.

A sample commit message should look like this

JIRA-ISSUE. Message.

eg.

DDC-1234. Sample commit message.

Customize

To customize the message validation to your liking simply modify the existing regular expressions in jira-commit-msg.py

MESSAGE_REGEX = '^DDC-[\d]{4}\. [\w\d .,:;+]*\.$'
BRANCHNAME_REGEX = '/(DDC-[\d]{4})-' #should contain a capturing group

To test your regex you can simply do so here

License

git-commit-msg is released under the MIT license.

About

Simple git commit-msg hook to ensure Jira issue numbers are part of the commit message.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published