mirror of
https://github.com/zhigang1992/linux-configs.git
synced 2026-01-12 22:48:27 +08:00
Corrected the grep to properly identify the 'tested on' string, and prevent it's inclusion if present. The 'tested on' string should still be included if the amendment is made on a later date. Tested-on: arcturus <09 Jan 2014>
18 lines
613 B
Bash
Executable File
18 lines
613 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# An example hook script to prepare the commit log message.
|
|
# Called by "git commit" with the name of the file that has the
|
|
# commit message, followed by the description of the commit
|
|
# message's source. The hook's purpose is to edit the commit
|
|
# message file. If the hook fails with a non-zero status,
|
|
# the commit is aborted.
|
|
#
|
|
|
|
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
|
|
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
|
|
|
|
DATE=$(date +"%d %b %Y")
|
|
HOSTNAME=$HOSTNAME
|
|
TestedMSG="Tested-on: $HOSTNAME <$DATE>"
|
|
grep -qs "$TestedMSG" "$1" || echo "$TestedMSG" >> "$1"
|