feat(hooks): steer a plain git switch to madt_switch #868
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.
Depends on
#867 feat(git): a local surface to switch to an existing branch
sixfold-space/madtea
Reference
sixfold-space/madtea#868
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?
The gap
The local-git hook (
hooks/scripts/check-git-local.sh) says nothing about a plain same-repogit switch <branch>orgit checkout <branch>. It denies only the create forms (switch -c,checkout -b) and a switch on a foreign primary checkout. Two of its deny texts also say that a switch to an existing branch is "NOT affected".When
madt_switchlands (#867), an agent that runs rawgit switchgets no pointer to it. A switch moves HEAD, so it is a mutation, and the hook steers mutations to the madt_* tools by deny.What I want
git switch <branch>andgit checkout <branch>, and steers tomadt_switch, the same way it treats a branch create.madt_switchfor that case.Acceptance criteria
git switch <branch>andgit checkout <branch>are denied, and the text namesmadt_switch.git checkout -- <path>and the create forms keep their current behaviour.madt_switch.hooks/tests/cover each form.Depends on #867.