push_branch: refuse commits that leave git conflict markers #44
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dario/push-conflict-markers"
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?
Evidence
On #28, the local model pushed merge commit
4e3f0a9with a<<<<<<< HEADblock ininternal/dispatch/dispatch_test.go. The next commit (9a1606b) fixed it, so the branch tip built, but4e3f0a9does not compile. No review noticed it. Without a squash merge it would end up in main's history.Changes
internal/gitpush: before pushing,checkConflictMarkerschecks every commit the push would publish: the commits not yet on the remote branch or the base branch, at most 200. It reports files that commit changes and that contain a line starting with<<<<<<<or>>>>>>>.git commit --amendfor the last commit, otherwise squash the unpublished commits withgit reset --softto the last pushed commit.push_branchtool description and README.Test evidence
just check: passesTestRefusesConflictMarkers(real git), a re-enactment of4e3f0a9→9a1606b:a.txt in commit <merge>;reset --softto the last pushed commit and one clean commit, the push goes through.🤖 Generated with Claude Code