This file contains hidden or 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
#!/bin/sh | |
# | |
# Hook script to prepend the commit log message with a branch name | |
# Prepend the name of the branch only if: | |
# - branch name starts with one of the options in $BRANCH_STARTSWITH | |
# - branch name has not been manually prepended in the commit message | |
BRANCH_STARTSWITH=(dev- WIP XYZ-) | |
BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
COMMIT_MESSAGE=$(cat $1) |