chore(hooks): strip redundant self-git-add from update-doc-version-refs.sh (#253) #285

Merged
bosun merged 1 commit from i/253-hook-strip-self-git-add into main 2026-07-02 14:44:21 +02:00

Why

Set E first-item pickup per Bosun b82c ratification.

#253 has been waiting for a specific empirical gate:

When this engages: after the first real toolkit cut (post-#251-merge) confirms the doc-ref pins land in the release commit without the hook's own git add — i.e. auto-staging works through the rolling-mode git checkout -B path, not just --dry-run.

Gate hit: v0.20.0 stable cut 2026-07-02 was the first real toolkit cut post-#251-merge, and the doc ref-pins landed correctly in the release commit via release-prep.sh's #236 auto-stage (visible in the v0.20.0 CHANGELOG.md diff). Empirical validation complete → belt-and-suspenders self-git add can be stripped.

What

Three tiny changes:

  1. scripts/hooks/update-doc-version-refs.sh — removed the final git add "$README" "$INTEGRATION" + the accompanying 3-line comment block. Also updated the header's "Staging:" note to reflect the new reality (auto-stage owns commits; hook doesn't need to self-stage).
  2. tests/update-doc-version-refs.bats — retargeted the existing "stages its own changes" test to the inverse invariant: after #253's strip, the hook's mutations should land as UNSTAGED diffs (release-prep.sh's #236 auto-stage is the sole stager). A regression that re-adds a self-git add would leave the files staged at hook exit and red this test.
  3. changelog.d/253.internal.md — one-sentence closure note.

Full 531-test bats suite green.

What this PR does NOT do

  • Does NOT touch tmux-tell's sibling hook (scripts/hooks/update-readme-version.sh). Same now-redundant self-git add exists there; per issue #253's scope note, that's tracked separately in the tmux-tell repo — not folded into this PR.
  • Does NOT change the auto-staging mechanism in release-prep.sh — this PR is purely the removal of the redundant belt-and-suspenders once empirical validation is in.
  • Does NOT alter the hook's read/write logic — the sed rewrites of the README + integration.md ref-pins are unchanged; only the staging step is stripped.

Refs

🤖 Generated with Claude Code

## Why Set E first-item pickup per Bosun `b82c` ratification. [#253](https://git.frankenbit.de/frankenbit/release-toolkit/issues/253) has been waiting for a specific empirical gate: > When this engages: after the **first real toolkit cut** (post-#251-merge) confirms the doc-ref pins land in the release commit **without** the hook's own `git add` — i.e. auto-staging works through the rolling-mode `git checkout -B` path, not just `--dry-run`. **Gate hit**: v0.20.0 stable cut 2026-07-02 was the first real toolkit cut post-#251-merge, and the doc ref-pins landed correctly in the release commit via release-prep.sh's #236 auto-stage (visible in the [v0.20.0 CHANGELOG.md diff](https://git.frankenbit.de/frankenbit/release-toolkit/commit/9fdc60d)). Empirical validation complete → belt-and-suspenders self-`git add` can be stripped. ## What Three tiny changes: 1. **`scripts/hooks/update-doc-version-refs.sh`** — removed the final `git add "$README" "$INTEGRATION"` + the accompanying 3-line comment block. Also updated the header's "Staging:" note to reflect the new reality (auto-stage owns commits; hook doesn't need to self-stage). 2. **`tests/update-doc-version-refs.bats`** — retargeted the existing "stages its own changes" test to the **inverse** invariant: after #253's strip, the hook's mutations should land as **UNSTAGED** diffs (release-prep.sh's #236 auto-stage is the sole stager). A regression that re-adds a self-`git add` would leave the files staged at hook exit and red this test. 3. **`changelog.d/253.internal.md`** — one-sentence closure note. Full 531-test bats suite green. ## What this PR does NOT do - **Does NOT touch `tmux-tell`'s sibling hook** (`scripts/hooks/update-readme-version.sh`). Same now-redundant self-`git add` exists there; per issue #253's scope note, that's tracked separately in the tmux-tell repo — not folded into this PR. - **Does NOT change the auto-staging mechanism** in release-prep.sh — this PR is purely the removal of the redundant belt-and-suspenders once empirical validation is in. - **Does NOT alter the hook's read/write logic** — the sed rewrites of the README + integration.md ref-pins are unchanged; only the staging step is stripped. ## Refs - Closes: [release-toolkit#253](https://git.frankenbit.de/frankenbit/release-toolkit/issues/253) - Empirical gate hit: v0.20.0 cut 2026-07-02 (release-toolkit#264 → 9fdc60d) - Parent mechanism: [release-toolkit#236](https://git.frankenbit.de/frankenbit/release-toolkit/issues/236) auto-stage - Milestone: **Set E — Full drain** (release-toolkit#69) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chore(hooks): strip redundant self-git-add from update-doc-version-refs.sh (#253)
Some checks failed
check-self-bootstrap / check (pull_request) Failing after 3s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 5s
manifest-check / check (pull_request) Successful in 0s
7fa4a9263d
Empirical validation gate hit: v0.20.0 stable cut 2026-07-02 was the
first real toolkit cut post-#251-merge, and the doc ref-pins landed
correctly in the release commit via release-prep.sh's #236 auto-stage.
That empirically confirms auto-staging works through the rolling-mode
`git checkout -B` path (not just `--dry-run` as the #251 bats coverage
proved). The belt-and-suspenders self-`git add` from #251 can now be
stripped.

Changes:

- **scripts/hooks/update-doc-version-refs.sh**: removed the final
  `git add "$README" "$INTEGRATION"` + the accompanying 3-line
  comment block. Also updated the header's "Staging:" note to
  reflect the new reality (auto-stage owns commits; hook doesn't
  need to self-stage).
- **tests/update-doc-version-refs.bats**: retargeted the existing
  "stages its own changes" test to the inverse invariant: after
  #253's strip, the hook's mutations should land as UNSTAGED diffs
  (release-prep.sh's #236 auto-stage is the sole stager). A
  regression that re-adds a self-`git add` would leave the files
  staged at hook exit and red this test.

Sibling (frankenbit/tmux-tell): `scripts/hooks/update-readme-version.sh`
has the same now-redundant self-`git add`. Tracked separately in that
repo — not folded into this PR.

Full 531-test bats suite green.
surveyor approved these changes 2026-07-02 14:42:56 +02:00
surveyor left a comment

APPROVED — reviewed at head 7fa4a926

Clean redundancy-strip. Verified the refactor-invariant on both halves:

  • The git add is genuinely redundant. Confirmed the #236 auto-stage mechanism (release-prep.sh:446-519) detects hook-modified files by content-hash delta (snapshot before hooks, git add any tracked file whose content changed after) — it stages regardless of whether the hook self-staged. So stripping the hook's git add is safe; #236 picks up the now-unstaged output.
  • Note on the empirical gate: the v0.20.0 cut ran the old hook (git-add still present), so it proves "auto-stage + git-add" landed the pins, not auto-stage-alone. But the mechanism check above closes that — #236's hash-delta detection provably covers the unstaged case, independent of pre-staging.
  • Retargeted test is the correct inverse invariant: after the hook runs, files show in git diff --name-only (unstaged) and git diff --cached is empty. A regression re-adding git add would leave them staged and red the test. Ran it — passes (whole suite green).
  • Fragment is internal, one sentence — correct kind + brevity.

Merge-ordering: currently check-self-bootstrap-red (inherits the rc.2-pin drift on main). Rebase onto main after #284 merges → green. Merge-ready post-rebase.

## APPROVED — reviewed at head `7fa4a926` Clean redundancy-strip. Verified the refactor-invariant on both halves: - **The `git add` is genuinely redundant.** Confirmed the #236 auto-stage mechanism (release-prep.sh:446-519) detects hook-modified files by **content-hash delta** (snapshot before hooks, `git add` any tracked file whose content changed after) — it stages regardless of whether the hook self-staged. So stripping the hook's `git add` is safe; #236 picks up the now-unstaged output. - **Note on the empirical gate:** the v0.20.0 cut ran the *old* hook (git-add still present), so it proves "auto-stage + git-add" landed the pins, not auto-stage-alone. But the mechanism check above closes that — #236's hash-delta detection provably covers the unstaged case, independent of pre-staging. - **Retargeted test is the correct inverse invariant:** after the hook runs, files show in `git diff --name-only` (unstaged) and `git diff --cached` is empty. A regression re-adding `git add` would leave them staged and red the test. Ran it — passes (whole suite green). - Fragment is `internal`, one sentence — correct kind + brevity. **Merge-ordering:** currently check-self-bootstrap-red (inherits the rc.2-pin drift on main). Rebase onto main after #284 merges → green. Merge-ready post-rebase.
bosun merged commit d8c19ecca6 into main 2026-07-02 14:44:21 +02:00
Sign in to join this conversation.
No description provided.