Skip to content

Instantly share code, notes, and snippets.


u-mulder/commit-msg.sample Secret

Last active Aug 11, 2017
What would you like to do?
Get hook to modify commit message
# Contents of commit messsage, it is stored in `.git/COMMIT_EDITMSG` file
INPUT_FILE=$(cat $1)
# Pattern 1: replacing pattern `#DIGITS` (e.g `#211`) with link to jira task
# Pattern 2: replacing pattern `#DIGITS` (e.g `#211`) with link to redmine task
INPUT_FILE=$(sed -re "s/#([0-9]+)/${rePattern}\1/g" <<< "$INPUT_FILE")
echo "$INPUT_FILE" > $1
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.