Skip to main content

Overview of Merging with NDMerge

This shows the merge targets and content of NDMerge.

Branch Merging

  • NDMerge merges Next Design data from the current branch (own) and a specified other branch (other).
  • Unlike standard Git merges which merge text differences, it builds Next Design file-specific data in memory and merges differences for each model.
  • It supports the following Next Design files, and builds data for each file:
  • nproj
  • nprof
  • nmdl
  • For example, it builds and merges the data of modelA.nmdl in the current branch (own) and modelA.nmdl in the specified other branch (other). Data from other model files has no effect on the merge of ModelA.nmdl.

Element-by-Element Merge Overview

NDMerge handles model-level changes as differences, rather than the typical line-by-line text changes. The merged results are reflected in the Next Design file. Conflicts will result in an error and the merge will fail.

Model Merge

  • If there are no model conflicts between the current branch (own) and the specified other branch (other), you can merge field values, model additions, deletions, etc.

Merge Example

  • The model data for each branch is shown below.
//Example of the base model
{
"Metamodel": "Use case",
"Fields": {
"Name": "Following driving (ADAPTIVE)",
"Description": "Driving while maintaining a safe distance from the vehicle ahead.",
"Scenarios$Embed": [ ]
}
}
//Example of the current branch (own) model
{
"Metamodel": "Use case",
"Fields": {
"Name": "Following driving (ADAPTIVE-DRIVE)", //Change the value of Name
"Description": "Driving while maintaining a safe distance from the vehicle ahead.",
"Scenarios$Embed": [ //Add one scenario
{
"Metamodel": "Scenario",
"Fields": {
"Name": "Basic flow", }
}]
}
}
//Example of a model in a specified other branch (other):
{
"Metamodel": "Use case",

"Fields": {
"Name": "Following driving (ADAPTIVE)",

"Description": "Driving while maintaining a safe distance from the preceding vehicle. If there is no preceding vehicle, constant speed driving occurs.", //Change the value of Description

"Scenarios$Embed": [ //Add one scenario
{
"Metamodel": "Scenario",

"Fields": {
"Name": "Exception flow (E1)", }

}]

}
}
  • The above changes to own and other do not conflict, resulting in the following merge result. In particular, adding elements to the Scenarios field is handled logically, merging the changes in both own and other.
//Example of the merged model
{
"Metamodel": "Use case",
"Fields": {
"Name": "Adaptive-Drive", //Merge own value
"Description": "Driving while maintaining a safe distance from the preceding vehicle. If there is no preceding vehicle, it will drive at a constant speed.", //Merge other value
"Scenarios$Embed": [ //Merge both own and other
{
"Metamodel": "Scenario",
"Fields": {
"Name": "Basic flow", }
}
{
"Metamodel": "Scenario",
"Fields": {
"Name": "Exception flow (E1)", }
}]
}
}

Merging Display Information

  • The position and size of diagram shapes, as well as styles such as background color and font, will be merged prioritizing the current branch (own).

  • Even if there are changes to the display information between the current branch (own) and the specified other branch (other), it will not be displayed as a conflict, and the changes in the current branch (own) will be adopted.

  • If you have specified a branch to prioritize merging as an option, the values ​​of that branch will be adopted.

Profile Merging

  • If there are no profile conflicts between the current branch (own) and the specified other branch (other), you can merge additions and deletions of classes and view definitions.
  • If there is a conflict, all contents of one branch will be adopted and committed.
    Changes that can be merged in the other branch will also be committed with the contents of the adopted branch.

:::see note

:::

Project Merging

  • If there are no conflicts in project information between the current branch (own) and the specified other branch (other), you can merge them.