Repository navigation
feat(git): git commit, git merge and git doctor — work with Mendix history the way Studio Pro does - #1670
Merged
Conversation
…ay Studio Pro expects
Ricovl
pushed a commit
to Ricovl/mxcli
that referenced
this pull request
Oct 28, 2026
…-branch fix: a fall-through error handler inside a branch loops or ends the flow (ako#1459)
git commit and git doctor — commit and audit the way Studio Pro expectsgit commit, git merge and git doctor — work with Mendix history the way Studio Pro does
ako
pushed a commit
that referenced
this pull request
Oct 29, 2026
`git remote get-url` applies url.<base>.insteadOf, and doctorEnv left the system, global and GIT_CONFIG_COUNT/KEY/VALUE configuration in place. In a sandbox that rewrites git@github.com: to https://github.com/ through the environment, the SSH remote the tests add already read back as HTTPS, and TestGitDoctor_SSHRemoteRewrittenByFix and TestGitDoctor_SSHURLFormRewrittenByFix failed `make test` on main (#1670) while CI was green. A ~/.gitconfig rewriting https to git@ fails the same two tests the other way. doctorEnv now sets GIT_CONFIG_GLOBAL to the null device, GIT_CONFIG_NOSYSTEM=1 and GIT_CONFIG_COUNT=0. Control: before the fix both tests fail under each rewrite separately (environment, and HOME with an https->git@ insteadOf); with an empty HOME and no environment rewrite they pass. After it, both rewrites pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011oK82sUVQEB3K5W5vh85wM
ako
added a commit
that referenced
this pull request
Oct 29, 2026
Sync ako/mxcli: git doctor/commit follow-ups to #1670, Mendix 9/10 writer gaps, module role description, test-runner false pass
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.
Closes #1669.
Why
A commit made with plain git (agent, CI, or anyone outside Studio Pro) leaves the repository missing what Studio Pro writes when it commits: the
mx_metadatanote (history shows(unknown), the version check fails), the local git config (core.autocrlf=Falsekeeps a checkout from rewriting line endings inside.mxunitfiles;mendix.commits-since-gc/mendix.lineEndingResetDoneare its bookkeeping), an HTTPS-only remote — and git itself cannot merge Mendix models (the.mpris SQLite,.mxunitfiles are BSON, so every two-sided model change is a binary conflict). A field repair script for exactly this state circulates internally.mxcli git note(#1337) already computes better notes than that script's template, but nothing audits a repository, commits the way Studio Pro does, or merges.What
mxcli git commit -m <msg> -p app.mpr [--push] [--dry-run]— Studio Pro's commit for commits made outside it: repairs ContentsHash mismatches from the files (MISSING/ORPHANrefuse), stages everything and unstages what Studio Pro never commits (project-settings.user.json,*.mpr.lock,*.mpr.bak,.mendix-cache/,deployment/,theme-cache/,.mxcli/; NUL-split--name-only -z, spaces safe), commits, computes and attaches the note, prints (or with--pushruns) the branch+notes push. Refused while.mpr.lockexists (honouringMXCLI_ALLOW_STUDIO_PRO_OPEN=1) and during unresolved merges;--dry-runwrites nothing.mxcli git merge <ref> [--plan <file>] [--ours|--theirs] [-m] [--push]— model-aware merging on the command line, on top ofmx git-merge(Studio Pro's own merge engine, resolved for the project's Mendix version):git mergeruns first; a merge git resolves itself is annotated likegit commitdoes;mx git-mergewith base/ours/theirs checked out into temporary worktrees — what it auto-resolves is committed as the two-parent merge commit with the note (measured:AutoResolved, both sides kept);ManualResolutionRequiredconflict is a review step, never a silent choice: the merge aborts, both sides' changes are printed at property level (viamx diff:New type > Length: 200 → 180/→ 250), and a plan template (<mpr>.merge-plan.json) is written. The human then re-runs with--planto resolve per unit ("take": "ours"|"theirs"per conflicted unit; the.mprindex is repaired from the mixed files),--ours/--theirswholesale, or in Studio Pro (Version Control › Merge Changes Here) — which stays the tool for within-unit mixed resolutions. Added/deleted/moved conflicts are refused to Studio Pro by plan validation. Non-model conflicts are left like plain git.mxcli git doctor [-p app.mpr] [--fix]— one read-only audit, exit 1 while an issue remains: the local config Studio Pro writes (core.autocrlfjudged —true/inputis repaired; themendix.*counters only backfilled when missing, their values are Studio Pro's own — measured on a real checkout), the remote URL scheme (SSHgit@host:…/ssh://…rewritten to HTTPS by--fix; other non-HTTPS reported), the remote's notes ref, and every commit's mx_metadata note on the checked-out branch — missing or malformed notes are reported;--fixcomputes real notes from the model (-p), falling back to a template note (--version, else the newest valid note in history) where the model at a commit cannot be read. Notes Studio Pro wrote are never touched.--fixdoes not push.Tests
TDD against real git repositories and real SQLite
.mprfixtures throughout (cmd/mxcli/gitdoctor_test.go,gitmerge_test.go): 30+ tests — commit end-to-end (note content, junk exclusion incl. spaced paths, hash-drift repair, lock refusal + override, unresolved-merge refusal, dry run writing nothing,--pushagainst a bare remote); doctor config/SSH/notes audit and repair (Studio Pro's own lowercase values pass; misspelled-prefused;--versionvalidated); merge clean/model-auto/manual-report/plan-mix/stale-plan/non-model/side-taking (notes asserted, worktrees verified removed).go build ./...,go vet(both tag sets), gofmt clean. Windows-only pre-existing failures (file-mode0600asserts, TempDir SQLite-handle cleanup) fail onmaintoo; Linux CI should not see them.Measured end-to-end in a dedicated lab repository (Studio Pro 11.12.6, real Team Server-shaped history):
mxcli git commit's note for the same model change is byte-identical to Studio Pro's own; Studio Pro opens every resulting revision cleanly.Docs
CHANGELOG (three
Addedentries), docs-site "Working Outside Studio Pro" (three new sections: One commit, all the steps, Merging branches, Auditing a repository), and theteamserver-gitskill updated (commit section leads withmxcli git commit; the model-merge rule now namesmxcli git mergeand the review flow; index regenerated).