This script was created to allow the addition of the Jira ticket number be added to the front of your commit message.
This allows for tracability with development and, as some places have rules that all commits must follow this structure, allows us not to not have to remember the jira ticket number or to but it in the commit message, lest we be forced to amend or force rebase our commit messages.
The base technology that allows this is Git Hooks and if you would like to know how this works I would recommend researching those.
- Place the script in the upper most directory of your git repository.
- Make sure you have permissions to execute the file ('ls -l')
- If you do not have permissions, add them using 'chmod -x addCommitMessageFormatter.h'
- Run the file './addCommitMessageFormatter.h'
- The file will delete itself after use. To validate it worked, check the file '.git/hooks/prepare-commit-msg' to see if it contain the necessary logic, or you can make a commit and see if it added the jira ticket.
- Abbility to take a file path as an input\
- the default file path would assume it is in top level of repo\
- Error checkers for touch, chmod, and printf\