Hi all,
I have attached shell script that will configure local git hook for commit
message on your local machine.
The only thing you have to do is to execute such script on your computer:
/bin/sh install_commit_msg_hook.sh {PATH_TO_DLAB_CHECKOUT_FOLDER}
E.g.
/bin/sh install_commit_msg_hook.sh /users/ubuntu/projects/DLab
After running script all commit messages should match following pattern:
'(?i)^EPMCDLAB-\d* ‘
In case of any problems with installation please feel free to contact me :)
#!/bin/sh
DLAB_HOME=$1;
if [ -z "$DLAB_HOME" ]
then
echo "Path to dlab home is required";
exit 1;
fi
echo "Creating commit-msg hook"
COMMIT_MSG_HOOK_FILE=$DLAB_HOME/.git/hooks/commit-msg
/bin/cat <<EOM>$COMMIT_MSG_HOOK_FILE
#!/bin/sh
MSG_PATTERN="^EPMCDLAB-\d* "
if ! grep -i "\$MSG_PATTERN" "\$1"; then
echo "Commit message should matched pattern \$MSG_PATTERN"
exit 1
fi
EOM
echo "Making commit hook executable"
chmod +x $COMMIT_MSG_HOOK_FILE
echo "Hook is successfully created"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]