Skip to content
Snippets Groups Projects
Verified Commit 12b22679 authored by Taico Aerts's avatar Taico Aerts
Browse files

Update git hook script


Made the git hook script more expressive.
Signed-off-by: Taico Aerts's avatarTaico Aerts <t.v.aerts@tudelft.nl>
parent c014199d
Branches
Tags
2 merge requests!201Development,!199Improve Explanation for Windows/Mac Users
......@@ -2,11 +2,19 @@
#
# Put this script inside the root folder of your git directory before running it.
cat >.git/hooks/commit-msg <<'EOF'
if cat >.git/hooks/commit-msg<<'EOF'
#!/bin/sh
grep "^Signed-off-by:" "$1" || {
echo >>"$1"
echo "Signed-off-by: $(git config user.name) <$(git config user.email)>" >>"$1"
}
EOF
chmod +x .git/hooks/commit-msg
\ No newline at end of file
then
chmod +x .git/hooks/commit-msg || {
echo "Installation failed: failed to adjust permissions"
exit 1
}
echo "Installed git commit hook successfully"
else
echo "Installation failed: could not write the commit hook"
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment