14 lines
355 B
Plaintext
14 lines
355 B
Plaintext
|
#!/bin/sh
|
||
|
|
||
|
COMMIT_MSG_FILE="${1}"
|
||
|
COMMIT_SOURCE="${2}"
|
||
|
SHA1="${3}"
|
||
|
|
||
|
# Only run on new commits.
|
||
|
if [ -z "${SHA1}" ] && [ -z "${COMMIT_SOURCE}" ]; then
|
||
|
# Show last 4 commit messages.
|
||
|
echo '' >> "${COMMIT_MSG_FILE}"
|
||
|
echo '# Previous commits:' >> "${COMMIT_MSG_FILE}"
|
||
|
git log --pretty=format:'# %h %s' | head -n 4 >> "${COMMIT_MSG_FILE}"
|
||
|
fi
|