commit: refuse on the default branch by default; allow_default_branch= / --allow-default-branch override #223
Labels
No labels
breaking
bug
documentation
enhancement
epic
good first issue
help wanted
refactoring
resolution/duplicate
resolution/invalid
resolution/wontfix
security
severity/critical
severity/high
severity/low
severity/medium
status/abandoned
status/blocked
status/needs-decision
status/needs-info
status/needs-verification
testing
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sixfold-space/madtea#223
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements the recoverable-guard tier (#222) for commits. Today madt_commit happily commits on main - a confused working directory (the incident: an agent whose cwd landed on the primary checkout) builds history on the local default branch with nothing in the way until push-time branch protection, if any. finish already refuses the default branch; commit joins it, completing branch-commit-finish as the only madtea-shaped path onto the default.
Behavior (service seam, both surfaces inherit):
Pinned refusal text (MCP; CLI variant swaps the next-step commands and flag spelling; branch name is dynamic):
"refusing to commit on 'main' - it is this repository's default branch, and an unplanned default-branch commit is almost always a wrong-checkout accident that then has to be untangled by hand. Create a feature branch first: madt_branch_create(branch="feat/"). If this repository genuinely commits straight to its default branch, state that intent explicitly with allow_default_branch=true. Nothing was committed."
Acceptance criteria:
Depends on #222 (the ADR pins the tier and naming family this instantiates).