Skip to content

Commit d585281

Browse files
committed
Review merge
1 parent 4bc5892 commit d585281

1 file changed

Lines changed: 37 additions & 35 deletions

File tree

  • content/en/docs/refguide/general/mx-command-line-tool

content/en/docs/refguide/general/mx-command-line-tool/merge.md

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
title: "Merging and Diffing Commands"
3-
url: /refguide/mx-command-line-tool/merge
3+
url: /refguide/mx-command-line-tool/merge/
44
weight: 50
5-
description: "Describes the commands related to merging and diffing apps for the mx command-line tool."
5+
description: "Describes the commands for comparing and merging apps using the mx command-line tool."
66
---
77

88
## Introduction
99

10-
The commands in this group enable comparing two apps and merging them.
10+
The commands in this group compare two apps and merge them.
1111

1212
## mx diff Command {#diff}
1313

@@ -24,16 +24,17 @@ These are the `OPTIONS`:
2424
| Option | Shortcut | Result |
2525
| --- | --- | --- |
2626
| `--help` | | Shows help for the `mx diff` command and exits. |
27-
| `--loose-version-check` | `-l` | Makes the version check loose (meaning, it auto-converts if possible before diffing). |
27+
| `--loose-version-check` | `-l` | Makes the version check loose. This auto-converts files if possible before comparing them. |
2828

29-
`BASE` is the first *.mpr* file, which is used as a base in comparison.
29+
`BASE` is the first *.mpr* file, used as the base for comparison.
3030

31-
`MINE` is the second *.mpr* file, which is used as the changed version in comparison. The output will contain the changes that are in this file against the base.
31+
`MINE` is the second *.mpr* file, used as the changed version for comparison. The output contains the changes in this file compared to the base.
3232

3333
{{% alert color="info" %}}
34-
For example, if the `BASE` *.mpr* has Microflow1 and the `MINE` *.mpr* does not have it, Microflow1 will be listed as deleted in the output file. If you swap the `BASE` and `MINE` parameters and compare again, Microflow1 will be listed as added.{{% /alert %}}
34+
For example, if the `BASE` *.mpr* file contains Microflow1 and the `MINE` *.mpr* file does not contain it, Microflow1 is listed as deleted in the output file. If you swap the `BASE` and `MINE` parameters and compare again, Microflow1 is listed as added.
35+
{{% /alert %}}
3536

36-
`OUTPUT` is the name of the outputted JSON file.
37+
`OUTPUT` is the name of the output JSON file.
3738

3839
### Examples
3940

@@ -54,9 +55,9 @@ This table shows the return codes and their description:
5455

5556
## mx merge Command {#merge}
5657

57-
The `mx merge` command performs a three-way merge of two *.mpr* files by taking their common ancestor (base) into account.
58+
The `mx merge` command performs a three-way merge of two *.mpr* files using their common ancestor (base).
5859

59-
The input is three *.mpr* files: `BASE`, `MINE`, and `THEIRS`.
60+
The input is three *.mpr* files: `BASE`, `MINE`, and `THEIRS`.
6061

6162
### Usage
6263

@@ -70,9 +71,9 @@ These are the `OPTIONS`:
7071
| --- | --- |
7172
| `--help` | Shows help for the `mx merge` command and exits. |
7273

73-
`BASE` is common base version of the app. If the app is version-controlled, this is the last common revision of the app (the revision that is present in the history of both branches).
74+
`BASE` is the common base version of the app. If the app is version-controlled, this is the last common revision of the app (the revision present in the history of both branches).
7475

75-
`MINE` is the version to merge into. This *.mpr* contains the results of the merge.
76+
`MINE` is the version to merge into. This *.mpr* file contains the results of the merge.
7677

7778
`THEIRS` is the version to merge changes from.
7879

@@ -82,32 +83,33 @@ The image below illustrates the meaning of the parameters:
8283

8384
In the diagram, note the following:
8485

85-
* <span style="color:green">**A"**</span> is `MINE`, which is the current commit you want to merge the changes to
86-
* <span style="color:orange">**B'**</span> is `THEIRS`, which is the last commit on a branch you want to merge changes from
87-
* <span style="color:red">**A**</span> is `BASE`, which is the common commit where the branches diverged
86+
* <span style="color:green">**A"**</span> is `MINE`, the current commit you want to merge changes into
87+
* <span style="color:orange">**B'**</span> is `THEIRS`, the last commit on the branch you want to merge changes from
88+
* <span style="color:red">**A**</span> is `BASE`, the common commit where the branches diverged
8889

89-
In order to merge changes correctly, Studio Pro has to compare both **A"** and **B'** against **A** to see what has been changed on each branch. During the merge, the [merge algorithm](/refguide/merge-algorithm/) will try to automatically merge the changes.
90+
To merge changes correctly, Studio Pro compares both **A"** and **B'** against **A** to see what changed on each branch. During the merge, the [merge algorithm](/refguide/merge-algorithm/) attempts to automatically merge the changes.
9091

9192
This command works for any three *.mpr* files. This means you can try to merge different apps at your own risk.
9293

9394
{{% alert color="info" %}}
94-
This command works differently than the normal version-controlled merges you can do in Studio Pro. While Studio Pro does a real merge of one branch into another, this command runs the merge algorithm over three *.mpr* files that do not even have to be version-controlled. {{% /alert %}}
95+
This command works differently than the normal version-controlled merges you can do in Studio Pro. Studio Pro performs a true merge of one branch into another. In contrast, this command runs the merge algorithm on three *.mpr* files that do not need to be version-controlled.
96+
{{% /alert %}}
9597

9698
### Conflicts
9799

98100
If there are conflicts during the merge, resolve them by opening the app in Studio Pro and selecting **Version Control** > [Merge Changes Here](/refguide/version-control-menu/#merge-changes-here).
99101

100-
The reason for this is that conflict resolution is a complex process that has two requirements:
102+
Conflict resolution is a complex process that has two requirements:
101103

102-
* The app has to be version-controlled
103-
* Your Git repository has to be in the merge state (Studio Pro does this when you click **Merge Changes Here**)
104+
* The app must be version-controlled.
105+
* Your Git repository must be in the merge state. Studio Pro sets this when you click **Merge Changes Here**.
104106

105-
This merge state is needed for Studio Pro to know what your current branch is and which branch you are trying to merge into it. This way, when you are trying to resolve the conflict using the `THEIRS` document, Studio Pro can download the document from the branch and put it into your current app.
107+
Studio Pro needs this merge state to identify your current branch and the branch you are merging into it. When you resolve the conflict using the `THEIRS` document, Studio Pro can download the document from the branch and add it to your current app.
106108

107-
So, if you run this command from the command line specifying the three *.mpr* files but the result has conflicts, you will not be able to resolve the conflicts in the `MINE` app using the `THEIRS` documents by just opening the app in Studio Pro. Instead, you need to configure Git to use `mx merge` as a [merge driver](#merge-git-driver) for the *.mpr* files and trigger the merge from the Git command line (so the repository is put in the merge state for Studio Pro to be able to pick it up after the command is complete).
109+
If you run this command from the command line with three *.mpr* files and the result has conflicts, you cannot resolve the conflicts in the `MINE` app using the `THEIRS` documents by opening the app in Studio Pro. Instead, configure Git to use `mx merge` as a [merge driver](#merge-git-driver) for the *.mpr* files and trigger the merge from the Git command line. This puts the repository in the merge state so Studio Pro can access it after the command completes.
108110

109111
{{% alert color="warning" %}}
110-
`mx merge` as a [merge driver](#merge-git-driver) is suitable only for [MPRv1 Format](/refguide/troubleshoot-repository-size/#mpr-format)
112+
Using `mx merge` as a [merge driver](#merge-git-driver) is suitable only for [MPRv1 Format](/refguide/troubleshoot-repository-size/#mpr-format).
111113
{{% /alert %}}
112114

113115
### Examples
@@ -122,28 +124,28 @@ This table shows the return codes and their description:
122124

123125
| Return Code | Description |
124126
| --- | --- |
125-
| `0` | The merge is successful and there are no conflicts. *MINE.mpr* contains the result of the merge. |
127+
| `0` | The merge is successful with no conflicts. *MINE.mpr* contains the merge result. |
126128
| `2` | Conflicts are detected. Open *MINE.mpr* in Studio Pro to resolve them. |
127-
| `4` | The version is unsupported. |
128-
| `129` | There is an exception, an error occurred during the merge. Error details are printed in the command line output. |
129+
| `4` | The version is not supported. |
130+
| `129` | An error occurred during the merge. Error details are printed in the command line output. |
129131

130132
## mx merge as Git Merge Driver {#merge-git-driver}
131133

132134
{{% alert color="warning" %}}
133-
`mx merge` as a [merge driver](#merge-git-driver) is suitable only for [MPRv1 Format](/refguide/troubleshoot-repository-size/#mpr-format)
135+
Using `mx merge` as a [merge driver](#merge-git-driver) is suitable only for [MPRv1 Format](/refguide/troubleshoot-repository-size/#mpr-format).
134136
{{% /alert %}}
135137

136138
{{% alert color="info" %}}
137139
Studio Pro configures the merge driver for an app with the name **studiopro** when opening it in Studio Pro.
138140
{{% /alert %}}
139141

140-
This section outlines the necessary configuration to enable the [mx merge](#merge) command as a merge driver in Git. With this configuration, you can merge one branch into another using third-party version control tools and the Git command line.
142+
This section outlines the configuration needed to enable the [mx merge](#merge) command as a merge driver in Git. With this configuration, you can merge one branch into another using third-party version control tools and the Git command line.
141143

142-
Normally, when you are merging branches with Git, it compares the file changes in both branches. If a certain file has been changed in both branches, this triggers a conflict. If conflicting files are text files, Git attempts to resolve it automatically (very often successfully).
144+
When you merge branches with Git, it compares the file changes in both branches. If a file changed in both branches, this triggers a conflict. If conflicting files are text files, Git attempts to resolve the conflict automatically and often succeeds.
143145

144-
However, if the conflicting files are Mendix apps, the conflict occurs in two .mpr files. Both the files and the conflict itself are more complex, which is why Studio Pro is needed to resolve them.
146+
However, if the conflicting files are Mendix apps, the conflict occurs in two *.mpr* files. Both the files and the conflict itself are more complex, so you need Studio Pro to resolve them.
145147

146-
For such cases, Git provides an option to delegate conflict resolution for specific file types to an external tool. The `mx merge` command is designed to work with this mechanism, allowing Git to attempt merging the *.mpr* files as Studio Pro would. If conflicts remain, you can open Studio Pro and resolve them manually.
148+
Git provides an option to delegate conflict resolution for specific file types to an external tool. The `mx merge` command works with this mechanism, allowing Git to attempt merging the *.mpr* files as Studio Pro would. If conflicts remain, you can open Studio Pro and resolve them manually.
147149

148150
### config File {#merge-config}
149151

@@ -201,11 +203,11 @@ CONFLICT (content): Merge conflict in MyBlankApp.mpr
201203
Automatic merge failed; fix conflicts and then commit the result.
202204
```
203205

204-
Now, if you open you app on the **Main** branch, you should see the following:
206+
Now, if you open your app on the **Main** branch, you should see the following:
205207

206-
* Both the **branch** and **main** microflows (this is a non-conflicting change, so `mx merge` sorted this out automatically, just like Studio Pro would do)
207-
* A conflict on the **Home_Web** page concerning the renaming of home page caption (this is a conflicting change, as you changed the same caption to different values on both branches, so you can resolve this manually)
208+
* Both the **branch** and **main** microflows. This is a non-conflicting change, so `mx merge` resolved this automatically, just as Studio Pro would.
209+
* A conflict on the **Home_Web** page concerning the home page caption. This is a conflicting change because you changed the same caption to different values on both branches. You can resolve this manually.
208210

209211
{{% alert color="info" %}}
210-
When you get a different output, the custom merge drive is not configured correctly. Abort the merge using the command `$git merge --abort` and close the Git command line tool before making changes to the configuration. Changes made to the configuration *config* and *.gitattributes* files are picked up by reopening the Git command line tool.
212+
If you get different output, the custom merge driver is not configured correctly. Abort the merge using the command `$git merge --abort` and close the Git command line tool before making changes to the configuration. Changes made to the *config* and *.gitattributes* files are picked up when you reopen the Git command line tool.
211213
{{% /alert %}}

0 commit comments

Comments
 (0)