Resolving every conflict to the upstream side hides exactly the local work that sits inside the conflicts
Resurfaces when
- about to sort a pile of uncommitted files into "already upstream" and "still unique" before resetting a checkout
- scripting a three-way merge with --theirs or --ours to see what local work survives
- moving uncommitted work from an old base onto a branch cut from a newer upstream
- a file reported as having no unique local changes still differs a lot from upstream
The lesson’s retrieval contract, weighted three times heavier than its body. A lesson that states when it applies doesn’t need a semantic search to find it.
The lesson
A three-way merge that settles every conflict in favour of one side is a fine way to produce a file, and a misleading way to measure one. Asked "which of my local changes are not upstream yet?", a script that merges each file with "upstream wins" and diffs the result against upstream reports only the local changes that merged cleanly. Every local change that overlapped an upstream change was inside a conflict hunk, and the forced resolution threw it away before the diff ran. So the measurement is blind to exactly the work most likely to be unique and valuable: the work that touched the same places upstream was also changing.
The overlap is more common than it seems. Two people appending new tests to the end of the same file produce one conflict that holds both appended blocks whole. A "keep upstream" resolution drops the local block entirely, and the file reads as "nothing unique here".
The same pass also errs the other way: lines that look unique by position can already exist upstream elsewhere, so "unique" has to be confirmed by name, not position.
The failure that taught it
A working tree held over a hundred uncommitted files left over from several finished pull requests, mixed with two pieces of unshipped work. To sort them before resetting the tree, each file was merged against the new upstream with a one-sided resolution and diffed, to list "local work upstream lacks". The list named the service file of one unshipped feature but not its test file. That test file carried nearly a thousand lines of new cases appended at its end, the same place upstream had appended its own tests, so the entire block sat inside one conflict and was discarded by the resolution. An earlier look had already noticed the file differed heavily from upstream. Without that, the reset would have deleted the only copy of those tests.
In the same pass one small block was listed as unique although upstream already had it, and a hand-rebuilt import line lost one name, which only the type checker and the moved tests caught.
How to apply it
- Before trusting any "unique local changes" list built from merges, count the conflicts per file first (a scripted three-way merge reports how many it hit). Every file with a conflict needs its conflict hunks read by eye. A one-sided resolution is not an answer for them.
- Measure in both directions. Diff local against its own base, which is everything you wrote, then check each added block against upstream by content or symbol name, not by line position.
- Treat a symbol as unique only after confirming upstream lacks it by name.
- After moving work onto a new base, run the type checker and the moved tests. A not-defined error in a moved test usually means a rebuilt import lost a name, not a logic bug.
- Back up the whole working tree (tracked diff plus untracked files) and confirm the backup reverse-applies to the current tree before any reset that a sorting script justified.
Where this claim comes from
- Lesson
Resolving every conflict to the upstream side hides exactly the local work that sits inside the conflicts
- Distillationhand-written
A note migrated from one project before the pipeline existed. No stated mechanism, which is why it ranks low in recall.
- Scar1 occurrence
One recorded failure — weaker evidence, and ranked accordingly rather than presented as settled.
- Evidencenone recorded
No source records recorded — hand-written and migrated lessons predate the pipeline that captures them.
What happened when it was used
- 3
- retrieved
- 2
- acted on
- 0
- held up
- 0
- did not hold up
Applied 2 times. Outcomes move the ranking both ways, which is what makes this improve rather than just grow.