summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-08-17 22:12:05 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-08-17 22:26:19 +0300
commit90e6bf908dce9ec3f9b87e755a11946146e5f714 (patch)
tree67b43a82eede3fdac55d27401674b2f033225e7b
parentf171dfbb3103de7802013471aac7ba3082ee2618 (diff)
git-request-pull: Check for .gitignore patternsHEADmaster
Commits should not touch any file matchin .gitignore patterns. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rwxr-xr-xgit-request-pull.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/git-request-pull.sh b/git-request-pull.sh
index 1058d2e..957a760 100755
--- a/git-request-pull.sh
+++ b/git-request-pull.sh
@@ -92,6 +92,20 @@ check_commit()
errors=$((errors+1))
}
fi
+
+ # 4. The commit should not contain any file matching .gitignore
+ # patterns.
+ local files=$(git show --format= --name-only $commit | \
+ git check-ignore --stdin --no-index)
+ if [ -n "$files" ] ; then
+ echo "Commit $summary contains files matching .gitignore patterns:"
+ local file
+ for file in $files ; do
+ echo "- $file"
+ done
+
+ errors=$((errors+1))
+ fi
}
check_commits() {