Created
March 24, 2019 16:10
-
-
Save amatellanes/95ffa595e17cd3f918beb190f7d5b5b9 to your computer and use it in GitHub Desktop.
Check that a commit comment mentions the current branch name (potentially tracking issue ID)
This file contains 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
#!/usr/bin/env bash | |
HG_COMMIT_MESSAGE="$(hg tip --template {desc})" | |
HG_BRANCH="$(hg identify -b)" | |
if [[ ${HG_COMMIT_MESSAGE=} = *${HG_BRANCH}* ]]; then | |
exit 0 | |
fi | |
exit 1 |
This file contains 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
[hooks] | |
pretxncommit.issue_id_required = ~/.hg_check_issue_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment