You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TL;DR:.githooks/pre-commit only checks staged files with --diff-filter=ACM (Added/Copied/Modified), never D (Deleted). Before #129, local builds never deleted anything under js//css/ (fixed js/ filenames, css/ only grew), so the gap was invisible. After #129 (which empties css/ before each build to stop stale hashed chunks from accumulating), a local npm run build && git commit -am ... will silently commit CSS deletions — the hook stays quiet, and CI's npm-build "check build changes" job even goes green on that commit since the output matches.
Detail
.githooks/pre-commit line ~14: git diff --cached --name-only --diff-filter=ACM -- js/ css/ (or equivalent) never surfaces deleted paths, so the hook's "you're about to commit generated build assets" guard silently misses deletions.
This repo's intended flow (per AGENTS.md) is: contributors run npm run build locally to test, then git restore --staged js css before committing — the hook is meant as a backstop for anyone who forgets. That backstop has a hole specifically for deletions.
Suggested fix: include D in the --diff-filter (e.g. --diff-filter=ACMD), so a staged deletion under js//css/ trips the same warning as an addition/modification.
TL;DR:
.githooks/pre-commitonly checks staged files with--diff-filter=ACM(Added/Copied/Modified), neverD(Deleted). Before #129, local builds never deleted anything underjs//css/(fixedjs/filenames,css/only grew), so the gap was invisible. After #129 (which emptiescss/before each build to stop stale hashed chunks from accumulating), a localnpm run build && git commit -am ...will silently commit CSS deletions — the hook stays quiet, and CI'snpm-build"check build changes" job even goes green on that commit since the output matches.Detail
.githooks/pre-commitline ~14:git diff --cached --name-only --diff-filter=ACM -- js/ css/(or equivalent) never surfaces deleted paths, so the hook's "you're about to commit generated build assets" guard silently misses deletions.AGENTS.md) is: contributors runnpm run buildlocally to test, thengit restore --staged js cssbefore committing — the hook is meant as a backstop for anyone who forgets. That backstop has a hole specifically for deletions.Din the--diff-filter(e.g.--diff-filter=ACMD), so a staged deletion underjs//css/trips the same warning as an addition/modification.