Skip to content

Commit 7c6e504

Browse files
authored
Merge pull request #651 from Adamant-im/trello.com/c/rKj7beCB
[trello.com/c/rKj7beCB] Added commit-msg hook
2 parents f49103f + cf0776f commit 7c6e504

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.githooks/commit-msg

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
REG='^.trello\.com\/c\/[a-zA-Z0-9]+.*$'
2+
BRANCH=$(git symbolic-ref --short HEAD)
3+
COMMIT_MSG=`head -n1 $1`
4+
5+
if [[ ! $COMMIT_MSG =~ $REG ]]; then
6+
cat $1
7+
> .git/COMMIT_EDITMSG
8+
echo "[$BRANCH] $COMMIT_MSG" >> .git/COMMIT_EDITMSG
9+
fi

scripts/init_hooks.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cp -R ./.githooks/commit-msg ./.git/hooks

0 commit comments

Comments
 (0)