Merging

Introduction

At times there may be a need to branch off a translation project, so that two translation projects exists, the main one and the branch. Various people then can work on the branch. After some changes have been made, there may be a need to merge the branched project back into the main project.

Some teams have a main project and an edited project. The main project is maintained by one person. All the members of the team work on the edited project. At times the person that maintains the main project would wish to merge the data of the edited project into the main one.

Bibledit provides the "Merge" tool for the above scenarios and for any other scenario the user can use it for.

Setup

In order for data of two projects to be merged succesfully, both of the projects need to have what is called a common ancestor. That means that going back in the history of the projects, there must be a moment in time that the data of the projects was the same. Usually this is accomplished by:

1. Making a copy of the main project. The main project remains as it is, and the copy of that project becomes the "edited" project.

2. Exporting a file of one project and importing it into the other one.

So, the setup is simple. Just take one project, or export from one project and import it into the other one. The data of these two projects is now capable to be merged after some changes have been made in the text.

Operation

So, how does the merge work?

The first step is to open two projects in the same window, so that both of these projects are visible at the same time.

Then open the merge window.

In the merge window, it asks for the master project, and the edited project. If both of these are selected, then the text of the projects will show up in the window.

Any changes are visible in that window. Additions are marked in bold and deletions in strike-through. It is important to know at this stage that any footnotes, endnotes and crossreferences are not marked this way.

If the editor goes to another chapter, the changes will be reloaded.

There are also two buttons in the merge window, one labelled "Previous", and one "Next". These buttons, if clicked, will look for the next or previous chapter that has changes.

Then there is the "Merge" button. Clicking this button starts the merge procedure.

It shows various possible actions to take. These are described below.

Merge chapter of edited project and master project

Once the merge operation starts it looks through the history of both projects to find the common ancestor for this chapter. It then tries the merge operation. If all went fine, then that's it: The job has been done.

Here follows a bit of a description of the merge process. It is not so that the last change that was made in any of the projects will be taken. It works slightly different. There is the master project, and the edited project. If the user merges these both, then the tool is going to look back in the history of all changes ever made in that chapter, till it finds the point that this particular chapter is the same in both master and edited project. It then looks at the changes made in the master project, and tries to keep these. It also looks at the changes made in the edited project, and tries to keep these too. It then puts both of these changes in a new chapter, and finally saves that chapter in both master and edited project, so that we can truly say that a merge has occurred. The goal is that this chapter is going to be merged, and will after merge be the same in both projects.

If all did not go well, then that means that there were changes in both of the projects that would affect one and the same place. Bibledit does not know in such a case which of the two changes is the correct one, and needs the user to select the correct text. A window will then open showing one or more pairs of buttons. Each button has a label showing the possible text. Clicking on the one button inserts the one text, and clicking the other button inserts the other text. If you click a button, it means that you approve of the text that is in its label. When all places have been corrected, then the OK button at the bottom of the window becomes active. Clicking that saves the text, and ends the merge operation.

Merge chapter of edited project and master project, and approve of each change as compared to master project

This is an addition to the simple merge procedure as descibed above. The extra thing here is that changes are not automatically accepted. Each change must be approved of manually. A window becomes visible that allows to approve of change. If a button has a "+", then it means there is an addition to the master project. And if it has a "-", then that means that something was deleted from the master project. Approval of a change is made by just clicking the button. Once one or more changes have been approved, if the user clicks the "Save" button, then the changes will be saved in the master project. Change won't be saved to the edited project. If that is desired, as it usually is, then the merge operation should be repeated, with the option chosen to copy the chapter from the master project to the edited project.

Copy chapter of master project to edited project

This copies a chapter from the master project to the edited project. The chapter to be copied is the one that is visible in the editor.

Copy everything of master project to edited project

This copies everything from the master project to the edited project. Useful for ensuring that the edited project is the same as the master.