1 Commits

Author SHA1 Message Date
Bart van der Braak
ddc0881e24 Git hook to reject commit messages with HTML tags in them 2025-12-18 11:46:30 +01:00
6 changed files with 66 additions and 44 deletions

View File

@@ -2,40 +2,34 @@
## Reject Merge Commits
The `blender_merged_hook` script rejects merge commits to branches were we don't want them. It is installed as an `pre-receive` hook in the following repositories:
- `blender/blender`
- `blender/blender-addons`
- `blender/blender-addons-contrib`
- `blender/blender-assets`
- `blender/blender-benchmarks`
- `blender/blender-developer-docs`
- `blender/blender-manual`
- `blender/blender-test-data`
- `blender/lib-linux_x64`
- `blender/lib-macos_arm64`
- `blender/lib-macos_x64`
- `blender/lib-source`
- `blender/lib-windows_arm64`
- `blender/lib-windows_x64`
- `brecht/test-hooks`
`blender_merged_hook` rejects merge commits to branches were we don't want them.
It is installed as an `pre-receive` hook.
## Deny Binary Files
The `deny-binary` script rejects commit that add binary files that should have been tracked as Git LFS object instead. We also provide some tests, which can be run using Docker Compose inside our Gitea container image. It has been installed as a `pre-receive` hook in the following repositories:
The `deny-binary` rejects binary files, that should have used LFS instead.
It is installed as a `pre-receive` hook.
To circumvent the rejection you can add `override restrictions` anywhere in the commit message.
## Repositories
Repositories with hooks:
- `blender/blender`
- `blender/blender-assets`
- `blender/blender-benchmarks`
- `blender/blender-developer-docs`
- `blender/blender-manual`
- `blender/blender-test-data`
- `blender/lib-linux_x64`
- `blender/lib-macos_arm64`
- `blender/lib-macos_x64`
- `blender/lib-source`
- `blender/lib-windows_arm64`
- `blender/lib-windows_x64`
- `studio/dogwalk`
To circumvent the rejection you can add `override restrictions` anywhere in the commit message.
Archived repositories that may have hooks, but are not longer being updated:
- `blender/blender-addons`
- `blender/blender-addons-contrib`
- `blender/blender-test-data`

View File

@@ -1,9 +0,0 @@
services:
gitea_deny_binary_tests:
image: ghcr.io/blender/gitea:v1.25.2
container_name: gitea_deny_binary_tests
working_dir: /workspace
command: bash -c "./test/run_deny_binary_tests.sh"
volumes:
- ./:/workspace
user: root

0
git-hooks/notice Executable file → Normal file
View File

View File

@@ -0,0 +1,48 @@
#!/bin/bash -eu
# Reject commits that contain HTML tags in their commit messages.
# Allow override with a special key phrase in the message.
set -o pipefail
nullsha="0000000000000000000000000000000000000000"
status=0
override_msg="override html check"
while read oldref newref refname; do
# Skip branch deletions
if [ "$newref" = "$nullsha" ]; then
continue
fi
# Handle new branches
if [ "$oldref" = "$nullsha" ]; then
oldref="HEAD"
fi
# Loop through each new commit
for commit in $(git rev-list ${oldref}..${newref}); do
# Get full commit message
msg=$(git log --format=%B -n 1 "$commit")
# Check for override
if echo "$msg" | grep -qi "$override_msg"; then
echo "Commit $commit allowed due to override message."
continue
fi
# Check for HTML tags
if echo "$msg" | grep -qE '</?[a-z][a-z0-9]*[^<>]*>'; then
echo "ERROR: Commit $commit contains HTML tags in the message."
echo "Message:"
echo "----------------------------------------"
echo "$msg"
echo "----------------------------------------"
echo "Please remove the HTML tags or use the override phrase:"
echo "\"$override_msg\""
status=1
fi
done
done
exit $status

View File

@@ -50,17 +50,6 @@
<a href="{{AppSubUrl}}/blender/blender/issues/141609">Under Development</a>
</td>
</tr>
<tr>
<td>
<a href="{{AppSubUrl}}/blender/blender/issues/153880">Modeling: Looptools</a>
</td>
<td>
Porting Looptools into core Blender.
</td>
<td>
<a href="{{AppSubUrl}}/blender/blender/issues/153880">Under Development</a>
</td>
</tr>
<tr>
<td>
<a href="{{AppSubUrl}}/blender/blender/issues/133001">Project Setup</a>

View File

@@ -6,12 +6,12 @@
<div class="description">
<ul>
<li>
<a href="{{AppSubUrl}}/blender/blender/milestone/33">Blender 5.2 LTS</a>
<a href="{{AppSubUrl}}/blender/blender/milestone/32">Blender 5.1</a>
— <strong>Alpha</strong>: New features and changes
</li>
<li>
<a href="{{AppSubUrl}}/blender/blender/milestone/32">Blender 5.1</a>
— Released March 17, 2026
<a href="{{AppSubUrl}}/blender/blender/milestone/20">Blender 5.0</a>
— Released November 18, 2025
</li>
<li>
<a href="{{AppSubUrl}}/blender/blender/milestone/25">Blender 4.5 LTS</a>