summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-08-14 16:53:27 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-08-14 16:55:34 +0300
commitdf1adc97856a08b56199b8ebc2ea4060c709d06e (patch)
treefe8e75e4c3622c5440cba7a518047082e3283a8a
parentcc539b7b9f35a6bc0735a8a8a47e1a54aefaef0e (diff)
gut-request-pull.sh: Check for local changelogs
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rwxr-xr-xgit-request-pull.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/git-request-pull.sh b/git-request-pull.sh
index 2b4835c..6a5afea 100755
--- a/git-request-pull.sh
+++ b/git-request-pull.sh
@@ -66,7 +66,14 @@ check_commits() {
local msg=$(git cat-file commit "$commit")
local summary=$(git show --pretty='format:%h ("%s")' -s $commit)
- # 1. The commit message shall have Signed-off-by lines
+ # 1. The commit message shall not contain a local changelog.
+ if echo -E "$msg" | grep -q '^--- *$'
+ then
+ echo "Found local changelog in commit $commit"
+ errors=$((errors+1))
+ fi
+
+ # 2. The commit message shall have Signed-off-by lines
# corresponding the committer and the author.
local committer=$(echo "$msg" | grep '^committer ' | head -1 | \
cut -d ' ' -f 2- | rev | cut -d ' ' -f 3- | rev)
@@ -84,7 +91,7 @@ check_commits() {
errors=$((errors+1))
fi
- # 2. Fixes: tags shall reference an ancestor commit.
+ # 3. Fixes: tags shall reference an ancestor commit.
local fixes=$(echo "$msg" | grep '^Fixes: ')
if [ -n "$fixes" ] ; then
fixes=$(echo "$fixes" | sed 's/^Fixes: \([0-9a-f]\+\) (.*)$/\1/')