Advertisement
Guest User

Untitled

a guest
Jul 29th, 2015
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #!/bin/sh
  2. # This hook will make sure that the commit message contains a JIRA issue.
  3. #
  4. # To enable this hook, rename this file to ".git/hooks/commit-msg".
  5. # Make sure to add execution permissions to the file.
  6.  
  7. export MESSAGE=$(<$1)
  8. export JIRA_ISSUE_TAG='ISSUETAG-([0-9]*)'
  9.  
  10. if [[ $MESSAGE =~ $JIRA_ISSUE_TAG ]]; then
  11. echo -e "\e[32mGreat, your commit message contains a JIRA issue!\e[0m"
  12. exit 0;
  13. fi
  14.  
  15. echo -e "\e[31mOh hamburgers ... You forgot to add a JIRA issue number!\e[0m";
  16. exit 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement