mirror of
https://github.com/OpenFOAM/ThirdParty-6.git
synced 2025-12-08 06:57:43 +00:00
21 lines
544 B
Bash
Executable File
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"
|