feat(gitflow): remove the origin copy of a branch once its merge is verified

`gitflow_delete` now ends with `_gitflow_delete_remote`: after the local
copy is gone, the remote tip is read with `ls-remote --exit-code`, checked
against develop/main with the same ancestor test, and only then removed
with `push origin --delete`. Same contract as the pushes (BDR-095): best
effort, warn never fail. No origin, `GITFLOW_NO_PUSH=1` or
`gitflow.autopush false` skip it; an unreachable origin or a remote tip
holding commits the bases lack keeps the remote branch, loudly. A base is
never targeted, by construction and by an explicit guard.

The static deny on hand `git push --delete` stays: it matches the Bash
tool's command string, the lib is the sanctioned path. Prose (hard_deny,
environment), doctrine, gitflow SKILL (table, op, warning row),
SETTINGS.md and CHANGELOG updated. T24: 9 checks (finish removes the
copy, bases untouched, unmerged remote tip kept, never pushed silent,
unreachable origin loud, autopush opt-out). 161/163, the 2 failures are
the pre-existing T16a (gitleaks absent on this host).
This commit is contained in:
bastien
2026-09-24 11:50:16 +02:00
parent abd1254d66
commit 68c9df354b
7 changed files with 104 additions and 18 deletions
+4 -4
View File
@@ -200,10 +200,10 @@ apply: the pre-commit hook (blocks code commits on main/develop, exempts
protection on `main`/`develop`. Don't lean on `--no-verify` to bypass them.
Every branch is pushed at `start` and every commit as it lands by the
post-commit and post-merge hooks (warn, never block, on failure). A branch
is deleted only by `finish` or `gitflow.sh delete <br>`: never `main` or
`develop`, never a branch not merged into develop or main (explicit
ancestor check; `git branch -d` proves nothing once the branch has an
auto-pushed upstream, T22a). The reference-transaction hook vetoes any
is deleted only by `finish` or `gitflow.sh delete <br>`, local and `origin/`
copy alike: never `main` or `develop`, never a tip not merged into develop
or main (explicit ancestor check; `git branch -d` proves nothing once the
branch has an auto-pushed upstream, T22a). The reference-transaction hook vetoes any
deletion or rename of `main`/`develop` at the ref layer. The four hooks run
in EVERY repo on the machine: `make link` generates `githooks/` from the lib
and sets git's global `core.hooksPath` to `~/.claude/githooks`; a repo that