Skip to content

A check that keeps the real coat of arms out of a commit - #47

Open
nordfisch wants to merge 1 commit into
developfrom
feature/logo-commit-guard
Open

A check that keeps the real coat of arms out of a commit#47
nordfisch wants to merge 1 commit into
developfrom
feature/logo-commit-guard

Conversation

@nordfisch

Copy link
Copy Markdown
Owner

Closes #46.

frontend/public/logo.png is a placeholder. A machine that sets a device up replaces it with the
municipal arms, and from then on it is a modified tracked file that rides along with the next
git add -A.

It happened twice. 6d47d36 is titled "Wappen aus der Historie entfernt". On 8 September 2026
it happened again: the real crest was swept into a commit and pushed to this public repository, then
taken back out and force-pushed. The warning in adaption.md prevented neither occasion.

The design, in one sentence

tools/check_logo.py reads the index, not the working tree.

On the machine setting a device up, the tree should hold the real crest — make release bakes it
into the frontend image from there, and the manual now says so. A check on the working tree would
refuse every commit on that machine and be switched off within the day. So the check asks
git diff --cached what the commit carries.

The way past it needs no exception: a staged change to the file is allowed when
tools/build_logo.py is staged with it, which is the one legitimate reason for the placeholder to
change. Two alternatives were rejected — a recorded hash is a value to keep in step, and
regenerating the PNG in the hook to compare bytes would break on the next Pillow release, since
nothing promises byte-identical output across versions.

It guards against the accident, not against intent. --no-verify was always there. The failure
being prevented is a sweep of git add -A, twice now.

Proven both ways, against the actual accident

Staged Result
the real crest alone exit 1, with the git restore --staged line in the message
the placeholder plus a changed build_logo.py exit 0
neither exit 0

The hook ran on this commit itself.

Where it sits

In .githooks/pre-commit and not in make check. The other seven checks answer whether the
tree is right; this one answers what a commit carries, so it needs an index. development.md and
decisions point 78 say so, and point 78 records why a rule that only a document stated was not
enough.

frontend/public/logo.png is a placeholder. A machine that sets a device up
replaces it with the municipal arms, and from then on it is a modified tracked
file that rides along with the next `git add -A`.

That is a legal problem: the arms are free of copyright as an official work,
but the municipality governs their use, and permission for one museum is not
permission for everybody who clones a public repository.

It happened twice. 6d47d36 is titled "Wappen aus der Historie entfernt", and on
8 September 2026 it happened again -- swept into a commit that was pushed, then
taken back out and force-pushed. The warning in adaption.md prevented neither.

tools/check_logo.py reads the **index**, not the working tree, and that is the
whole design: on the machine setting a device up, the tree should hold the real
crest, because `make release` bakes it into the image from there. A check on the
tree would refuse every commit there and be switched off within the day.

The way past it needs no exception: a staged change is allowed when
tools/build_logo.py is staged with it, which is the one legitimate reason for
the placeholder to change. No hash to keep in step, and no byte comparison
against a regenerated PNG, which would break on the next Pillow release.

Hook only -- it needs an index, so it is not in `make check`. Proven both ways
against the actual accident: red with the crest staged alone, green with the
generator staged beside it.

Closes #46.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nothing stops the real coat of arms from being committed

1 participant