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
{{ message }}
Repository navigation
Pre-commit hook doesn't flag deleted build assets (js/css) #132
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.
Activity