Created
February 21, 2018 12:42
-
-
Save amsoell/ada87ccc08c4277b384d0c164eebe108 to your computer and use it in GitHub Desktop.
Include last 5 commit messages and hashes in default Git commit message
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ORIG_MSG_FILE="$1" | |
TEMP=`mktemp /tmp/git-msg-custom` | |
trap "rm -f $TEMP" exit | |
LAST10=`git log --oneline -5 | sed -e 's/^/# /'` | |
(printf "\n\n# Last 5 Commits:\n%s \n\n" "$LAST10"; cat "$ORIG_MSG_FILE") > "$TEMP" | |
cat "$TEMP" > "$ORIG_MSG_FILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment