hermes: allow --force-with-lease in the approvals deny rules #29

Merged
repomaa merged 2 commits from chore/allow-force-with-lease into main 2026-10-01 00:11:41 +03:00
Collaborator

The git push --force* fnmatch glob swallowed --force-with-lease too (fnmatch * spans everything, including the -with-lease suffix), so the safe-lease rebase pushes were blocked alongside bare force-pushes.

What changes

  • [!-]-gated variants deny --force / -f bare or followed by a non-dash char — --force-with-lease (next char always -) no longer matches.
  • git push* variants catch flags placed after other arguments (git push origin main --force), which a prefix-anchored rule would miss.
  • New git push*+* rule denies refspec-level forced updates (git push origin +main), which the old glob never covered.

Verified

  • Matcher is fnmatch.fnmatchcase over per-segment normalized command variants (tools/approval_floors.py) — rule set tested against 14 real command spellings: all force spellings denied, --force-with-lease and plain pushes pass.
  • nix eval of freun-dev toplevel drvPath succeeds.
The `git push --force*` fnmatch glob swallowed `--force-with-lease` too (fnmatch `*` spans everything, including the `-with-lease` suffix), so the safe-lease rebase pushes were blocked alongside bare force-pushes. **What changes** - `[!-]`-gated variants deny `--force` / `-f` bare or followed by a non-dash char — `--force-with-lease` (next char always `-`) no longer matches. - `git push*` variants catch flags placed after other arguments (`git push origin main --force`), which a prefix-anchored rule would miss. - New `git push*+*` rule denies refspec-level forced updates (`git push origin +main`), which the old glob never covered. **Verified** - Matcher is `fnmatch.fnmatchcase` over per-segment normalized command variants (tools/approval_floors.py) — rule set tested against 14 real command spellings: all force spellings denied, `--force-with-lease` and plain pushes pass. - `nix eval` of `freun-dev` toplevel drvPath succeeds.
hermes: allow --force-with-lease in the approvals deny rules
Some checks failed
Build Images / build (pull_request) Has been cancelled
Check / check (pull_request) Has been cancelled
d4c90265f8
The 'git push --force*' fnmatch glob swallowed --force-with-lease too
(fnmatch '*' spans everything, including the '-with-lease' suffix), so
the safe-lease rebase pushes were blocked alongside bare force-pushes.

Replace it with [!-]-gated variants: a dash class denies --force/-f
bare or followed by a non-dash char, while --force-with-lease (next
char always '-') no longer matches. 'git push*' variants catch flags
placed after other arguments. 'git push*+*' additionally denies
refspec-level forced updates ('git push origin +main').
hermes: also deny refspec-level forced updates
Some checks failed
Build Images / build (pull_request) Has been cancelled
Check / check (pull_request) Has been cancelled
66e7272a64
'git push origin +main' is a force-push without either --force flag;
the old glob never covered it either.
hermes force-pushed chore/allow-force-with-lease from 66e7272a64
Some checks failed
Build Images / build (pull_request) Has been cancelled
Check / check (pull_request) Has been cancelled
to a1ca595e63
All checks were successful
Build Images / build (pull_request) Successful in 50s
Check / check (pull_request) Successful in 4m48s
2026-09-30 11:10:51 +03:00
Compare
repomaa force-pushed chore/allow-force-with-lease from a1ca595e63
All checks were successful
Build Images / build (pull_request) Successful in 50s
Check / check (pull_request) Successful in 4m48s
to ebc463748b
All checks were successful
Build Images / build (pull_request) Successful in 40s
Check / check (pull_request) Successful in 5m58s
2026-10-01 00:05:01 +03:00
Compare
repomaa scheduled this pull request to auto merge when all checks succeed 2026-10-01 00:06:58 +03:00
repomaa deleted branch chore/allow-force-with-lease 2026-10-01 00:11:41 +03:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
repomaa/nixos!29
No description provided.