A new feature touches the same 9 files, but only 1 shared one
Shared files edited went from 3 to 1, and a merge of two features had 0 conflicts instead of 2.
Adding one feature touches the same 9 files, but only 1 shared one
The feature is Quote: a table and an endpoint that counts quotes. It was added to both copies, then each copy was built, migrated and started; the endpoint answered 0, then 2 after two rows were inserted Measured.
The grid lists every file the feature touched; shared files have a pink row:
By hand
- 9
- files touched
- 3
- shared files edited
- 2
- shared files edited by a person
Generated
- 9
- files touched
- 1
- shared file edited (by EF)
- 0
- shared files edited by a person
Both ways touch 9 files, but by hand a person edits 2 shared lists, and generated a person edits none Measured. The snapshot change is the same 16 lines both ways, written by EF.
Two features merged: the hand-edited lists caused every conflict but the snapshot's
Branch A adds Quote; branch B, from the same start, adds a second feature; then B is merged into A. The chart counts the files in conflict:
- By hand
- Generated
Show as table
| By hand | Generated | |
|---|---|---|
| Quote + Badge | 2 | 0 |
| Quote + Quip | 3 | 1 |
two merges, measured
Generated wiring removed both hand-edited lists from every conflict Measured.
- Quote + Badge: by hand,
DomainServices.csandMainDbContext.csconflicted; generated, nothing did. The snapshot merged by itself both ways. - Quote + Quip: these names sort next to each other, so EF writes their parts of the snapshot side by side, and the snapshot conflicted both ways.
- After the fixes, both copies built, EF reported no pending changes, a fresh database got both tables, and both endpoints answered 200.
The fix for the snapshot conflict on the generated copy is one command:
- Take one sideKeep branch A's snapshot.
- Rebuild itBuild, then run dotnet ef migrations add Regen.
- Keep the snapshot onlyDelete the 2 migration files it wrote; keep the rewritten snapshot.
So the snapshot clashes only when two changes land near each other in it Measured.