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
### Keybase proof | |
I hereby claim: | |
* I am erikvdwal on github. | |
* I am erikvdwal (https://keybase.io/erikvdwal) on keybase. | |
* I have a public key whose fingerprint is FDED 9F7A 7D84 B3C1 826A 8630 F0AD D5B7 F534 5ABD | |
To claim this, I am signing this object: |
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
#!/bin/sh | |
COMMIT_FILE=$1 | |
COMMIT_MSG=$(cat $1) | |
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
JIRA_ID=$(echo "$CURRENT_BRANCH" | grep -Eo "[A-Z0-9]{1,10}-?[A-Z0-9]+-\d+") | |
IN_COMMIT=$(grep -c "$JIRA_ID:" $1) | |
if ! [[ $IN_COMMIT -ge 1 ]] && [ ! -z "$JIRA_ID" ]; then | |
echo "$JIRA_ID: $COMMIT_MSG" > $COMMIT_FILE |