Skip to content

Commit fd0d611

Browse files
committed
chore(git): add basic commit message template
1 parent a136e4d commit fd0d611

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.dev/githooks/prepare-commit-msg

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/sh
2+
#
3+
# This hook adds a comment for guidance about the commit message
4+
# format on top of the default commit message.
5+
#
6+
# Called by "git commit" with the name of the file that has the
7+
# commit message, followed by the description of the commit
8+
# message's source. The hook's purpose is to edit the commit
9+
# message file. If the hook fails with a non-zero status,
10+
# the commit is aborted.
11+
#
12+
# To enable this hook, rename this file to "prepare-commit-msg".
13+
14+
COMMIT_MSG_FILE=$1
15+
COMMIT_SOURCE=$2
16+
SHA1=$3
17+
18+
original=$(cat "$COMMIT_MSG_FILE")
19+
printf "\n\n# Please enter the message in the format\n" > "$COMMIT_MSG_FILE"
20+
echo "# <type>(<scope>): <description>" >> "$COMMIT_MSG_FILE"
21+
echo "# Possible types: fix, feat, docs, style, refactor, test, chore, rework, release" >> "$COMMIT_MSG_FILE"
22+
echo "# For details see https://www.notion.so/softwarechallenge/Git-217333329ea64db5b2cc8bbbaf79db87" >> "$COMMIT_MSG_FILE"
23+
echo "$original" >> "$COMMIT_MSG_FILE"

0 commit comments

Comments
 (0)