Files
ThirdParty-6/ParaView-5.0.1/Utilities/Scripts/prepare-commit-msg

21 lines
544 B
Bash
Executable File

#!/usr/bin/env bash
egrep-q() {
egrep "$@" >/dev/null 2>/dev/null
}
# First argument is file containing commit message.
commit_msg="$1"
# Check for our extra instructions.
egrep-q "^# Start the commit message" -- "$commit_msg" && return 0
# Insert our extra instructions.
commit_msg_tmp="$commit_msg.$$"
sed 's/^# \(On\|Not currently on any\) branch.*/'\
'# Start the commit message in "WIP: " to indicate Work In Progress\
# that is not yet ready to merge.\
#\
&/' "$commit_msg" > "$commit_msg_tmp" &&
mv "$commit_msg_tmp" "$commit_msg"