Repository navigation
Conversation
…e Studio Pro's own (measured on the lab repo, S0)
…he junk just unstaged (lab finding F4)
…th sides, then --ours/--theirs or Studio Pro (lab S5b)
…iff) and a plan file the human edits before landing (lab S5c)
|
My verdict on #1674 is request changes. Merging from the command line with Mendix’s own merge engine, plus a review step, is a good idea. As it stands, though: --ours/--theirs silently drop documents. How I checked it: the permission policy blocked building and running the PR’s own code, because it comes from an external contributor. So I replayed its git steps with my own commands, and called Mendix’s mx (11.13, on the pedapp fixture) exactly as the PR calls it. Its mx git-merge success path on Windows or macOS is therefore not something I could verify. Must fix The common fix for points 1 and 2: never take a whole side of App.mpr. Either merge its list of units three ways, or refuse and abort whenever the hash check finds orphaned or missing units. |
Follow-up to #1670 (closes the merge half of #1669).
What happened
#1670 was merged from an earlier state of its branch: the four commits pushed after
6a5c942fanever landed on main — themendix.commits-since-gcdoctor fix, the staged-files summary fix (F4), and the entiremxcli git mergefeature. This PR re-carries exactly those four commits, rebased onto current main (all cherry-picks clean, tests green).What
mxcli git merge <ref>doesgit mergecannot merge Mendix models: the.mpris SQLite and every.mxunitis BSON, so two sides changing the model always meet a binaryCONFLICT (content)(measured in a dedicated lab repo with Studio Pro 11.12.6: both files, every time). Studio Pro resolves that with a model-aware merge, and the same engine ships as a command —mx git-merge BASE MINE THEIRS BASE_COMMIT MINE_COMMIT THEIRS_COMMIT.mxcli git merge <ref> -p app.mprrunsgit mergefirst; a merge git resolves itself (disjoint files, fast-forward) is annotated likemxcli git commitdoes. On a model conflict the base and theirs revisions are checked out into temporary worktrees andmx git-mergedecides (mx resolved for the project's Mendix version — PATH, mxcli cache, Studio Pro installation):AutoResolved, both sides kept, note identical in shape to Studio Pro's own merge commit's.ManualResolutionRequired→ a review step, never a silent choice. The merge aborts (working tree exactly as before), and two things are produced for the human:mx diff, both sides:New type > Length: 200 → 180(ours) /→ 250(theirs), per conflicted unit;<mpr>.merge-plan.json, onetake: ours|theirsentry per conflicted unit,oursby default).The human edits the plan and re-runs with
--plan <file>: each unit is taken from its chosen side, the.mprindex is repaired from the mixed files (files are the truth), and the merge is committed with the note. Plan validation refuses units that are not modified-on-both-sides (added/deleted/moved conflicts) — those, and any resolution that must mix both sides inside one unit, stay in Studio Pro (Version Control › Merge Changes Here).--ours/--theirstake one side wholesale without consulting mx. Non-model conflicts (text sources) are left like plain git.Also re-landed (were in the branch but missing from main):
git doctorjudges onlycore.autocrlf; themendix.*keys are backfilled when missing and their values are never judged — measured on a real Studio Pro checkout,mendix.commits-since-gccounts up (was2, not0) and a healthy checkout must pass (fix 1);git commit's staged-files summary lists what the commit holds, not the junk just unstaged (fix 2).Tests
TDD, real git repositories + real SQLite
.mprfixtures (cmd/mxcli/gitmerge_test.go,gitdoctor_test.go): clean merges annotated; model conflicts auto-resolved via an injected mx runner (worktree paths and base/ours/theirs shas asserted); manual conflicts reported and aborted (MERGE_HEAD gone, tree restored); plans applied per unit with hashes repaired; stale plans refused; non-model conflicts left alone;--ours/--theirsdeterministic without mx; already-up-to-date. All green locally with the real mx on the lab repository (auto-resolve, report→plan→land,--theirs).Docs
CHANGELOG (
git mergeentry under Unreleased), docs-site "Working Outside Studio Pro" › Merging branches, and theteamserver-gitskill's model-merge rule.