Draft a message for each conflict's authors - #19
Draft
chris-peterson wants to merge 1 commit into
Draft
chris-peterson wants to merge 1 commit into
chris-peterson wants to merge 1 commit into
Conversation
3 tasks
chris-peterson
force-pushed
the
message-the-author-on-conflict
branch
2 times, most recently
from
September 23, 2026 00:23
b0a5309 to
653c7ad
Compare
A failed merge named the conflicting branch and its author's email, then offered commands, so whoever ran git fi was left to work the fix out on the authors' behalf, or to take the branch out with -r and move on. The authors of the conflicting branches are the ones who can resolve it, so the output now gives the reader something to send them: the branch, where it failed to merge (<project>@fi, from the origin URL), the first conflicting hunk, and what to do. The hunk comes from the tree the failed merge-tree probe already wrote, which carries git's conflict markers, so reading it needs no checkout. Probes run with merge.conflictStyle=diff3 so the merge base sits between the two sides. Its lines are a file's bytes printed to a terminal, so control characters are stripped, as they are for author emails. - A conflict with main ends with the fix as three steps. The rebase stops at the conflict for someone to resolve, so the push is its own step rather than the end of one chain that reads as automatic. The steps also pull first, which the old one-liner skipped, leaving it to rebase onto a stale origin/main. - A conflict between two peers is the failing branch author's to fix. Keeping a branch mergeable into main is its author's job with or without fi, and fi merges in insertion order, so the branch that failed is the later arrival. The message goes to its author and names the peer's author to talk to about how the two changes should fit together. Where the failing branch is the reader's own, it becomes a heads-up to the peer's author instead. - A branch of the reader's own gets the steps without a message. - A branch several failures collide with leads, with those failures grouped: one conversation with its author clears all of them. - The -r line, set off by a rule and coloured as a command to run, is introduced as the way to get fi building again now, alongside sending the messages. Author names come from the same git branch -r listing as the email: both share its last field, split at the first "<", which git's ident parser never lets into a name. Each --json conflict carries the same author as an object ({name, email}, null where git reported none), so a CI job can notify the author who can fix it.
chris-peterson
force-pushed
the
message-the-author-on-conflict
branch
from
September 23, 2026 00:50
653c7ad to
1126674
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
When
git fican't merge, it names the conflicting branch and its author, then prints commands for whoever ran it. The fix belongs to the branch owners, so the failure output now gives the person who ran it a ready-to-paste message for each conflict's authors: the branch,<project>@fi, the first conflicting hunk (diff3, so the merge base sits between the two sides), and what to do. The-rline stays, introduced as the way to get fi building again while those messages go out.Review guide
Critical path
src/readiness.ts— who gets messaged per conflict kind; your own branch gets the steps with no messagesrc/readiness.ts— hunk read from the failed probe's tree, no checkout; control bytes strippedsrc/readiness.ts— a branch several failures collide with leadsIntegration points
src/git.ts— name and email share the listing's last field, split at the first<src/merge.ts— keeps--jsonto its existing shapeAncillary
test/readiness.test.ts— teammate-authored branches, so the message path runsSPEC.md— READY-04docs/merge-process.md