commit: allow amend of a HEAD commit that the remote does not have #636
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#636
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
This proposal reverses part of legacy tracker 1580, which has no decision record. It does not change ADR 0029.
madtea commitandmadt_commitrefuse--amend. TheCHANGELOG.mdentry for legacy tracker 1580 says: "make a new commit instead of rewriting history." The plugin hooks also steer agents off rawgit commit. So an agent cannot amend a commit, even a commit that exists only in the local clone.This hurts most on a repo that merges fast-forward only, like this one. Every branch commit reaches
mainunchanged. A fix for a mistake in the previous unpushed commit stays onmainas a separate commit. I hit this on the branch for #631: its second commit only corrects its first.Why amend fits the destruction model
CHANGELOG.mdentry lists amend with the "irreversible, working-tree-destroying" modes. Amend is neither.internal/service/git/signing_guard.go:250) tells users to rungit commit --amend --no-edit -S.CHANGELOG.md,docs/COMPARISON.md, and code comments.Proposal
Add an amend option to
madtea commitandmadt_commit. It runs only when no remote-tracking ref contains HEAD. In every other case it refuses. So an amend never needs a force push.Costs
Acceptance
docs/COMPARISON.md, the help text, and the removed-flag redirect ininternal/cmd/git/commit.gomatch the new behavior.The main argument in this proposal does not hold. It says an amend is safe because "the old commit stays in the reflog, so it can be recovered". The decision on #635 sets the bar for any operation that can lose work: the proof must show that the work still exists on the remote. A reflog copy exists only in the local clone, so it does not meet that bar.
This proposal needs an argument that meets the #635 bar, or it closes.