Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@
# exits before doing any work, which is every commit that did not just merge a
# generator-owned artifact (#4675).
#
# One commit is exempt, and only one: the MERGE commit itself, which the
# sanctioned landing sequence (`scripts/pm/os-regen-merge.sh`, step 3) commits
# BEFORE regenerating, so that "what main brought" stays readable apart from
# "what the change produces". That commit records a deferral instead of being
# refused; the immediately following commit must discharge it, and
# `.githooks/pre-push` refuses the push if none ever does (#8047).
# One commit is exempt, and only one: a MERGE commit finished BY HAND, with
# `MERGE_HEAD` present at commit time — a conflicted merge an operator
# resolves and finishes with `git commit`. That commit records a deferral
# instead of being refused; the immediately following commit must discharge
# it, and `.githooks/pre-push` refuses the push if none ever does (#8047).
#
# The sanctioned landing sequence (`scripts/pm/os-regen-merge.sh`) does NOT
# hit that exemption: its step 1 merge auto-commits with no hook run at all
# (see below), so the marker is untouched going into step 3, whose commit is
# an ORDINARY one this hook refuses on purpose — that refusal is the designed
# collection point, "what main brought" read apart from "what the change
# produces" by the fallback it prints, not a deferral.
#
# ⚠️ git does not run this hook for a merge it completes ITSELF — only for one
# you finish with `git commit`. A clean auto-committed merge therefore lands
Expand Down
8 changes: 5 additions & 3 deletions scripts/check-regen-pending.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,11 @@ function main({ prePush = false } = {}) {
console.error(
`\nRegenerate ${owed}, \`git add\` them, and ${prePush ? 'commit the result before pushing' : 'commit again'}.\n`
+ ' This check clears itself the moment they are current — nothing to reset by hand.\n'
+ ' Landing a merge? `bash scripts/pm/os-regen-merge.sh` runs the sanctioned sequence — it commits\n'
+ ' the merge first (this hook records that as a deferral) and regeneration follows as its own\n'
+ ' commit. Every artifact above also has a required gate on the PR.\n',
+ ' Landing a merge? `bash scripts/pm/os-regen-merge.sh` runs the sanctioned sequence — its merge\n'
+ ' auto-commits first with no hook run at all (git skips pre-commit for a merge it completes\n'
+ ' itself), so THIS refusal, on the ordinary commit right after, is that sequence\'s designed\n'
+ ' collection point — not a deferral. Regeneration follows as its own commit; every artifact\n'
+ ' above also has a required gate on the PR.\n',
);
return 1;
}
Expand Down
Loading