add a madtea-dev command that splits a working-tree change into ordered atomic commits #629
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#629
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?
What
A large change can mix several concerns, even inside one file, while each concern must land as its own commit that builds and passes on its own. I split the #623 work this way with a Python script, which does not belong in a Go project, so it does not ship. This issue is the Go version, as a
madtea-devsubcommand.Behavior
path, a regex on the repo-relative path, and an optionalhunk, a regex on the hunk's removed and added lines.git diff -U0 HEAD, and every untracked, not-ignored file (as one hunk), goes to the FIRST step whose rule matches.--reportlists the assignment per step and fails when any hunk matches no step. It writes nothing.--stage STEPwrites into the index, for each touched file, HEAD's content plus only that step's hunks. The working tree is never modified. The hunks apply to HEAD's content in order, and a hunk whose removed lines do not match HEAD fails the run.--stagediffs against the new HEAD, so line numbers stay exact.Acceptance
--report; a mismatched hunk failing--stage; the working tree left untouched.scripts/README.mddescribes it.