Converting sim-recon tags and branches to the split repositories

From GlueXWiki
Jump to: navigation, search

First recall that the new halld_recon and halld_sim repositories are complete clones of the old sim-recon repository. That means they both contain all of the history of sim-recon as well as all of its tags and branches. Not all of the directories present in the old repository appear in the new repository just as you would expect; they have been deleted in a git-like manner. But those directories are still present in the history of each of the new repositories. The src/SBMS directory is the only directory contained in both. It had been modified in a new-repository-specific way for each new repository.

Branches

When you checkout your old sim-recon branch from a halld_recon or halld_sim repository, you will get the entire tree in its old sim-recon form. In particular you will get all of the code for both the sim stuff and tne recon stuff, and an SBMS directory that is meant to build both. That is after all, the last thing you pushed to the sim-recon repository. In the majority of cases, this is not a problem. You can do the sim-recon-style build even though the "origin" repository is halld_recon or halld_sim, test the resulting binaries, push your changes to halld_recon or halld_sim, and submit your pull request as before. The subsequent merge will use the new repository-appropriate SBMS directory, delete the directories that are now in the "other" repository and update the master with your changes.

Another scenario is that you want to maintain your changes on your branch, but want to transform the branch to have the new repository-specific build procedure and directories. In that case, you can merge the master onto your branch. That merge will delete the directories now in the "other" repository and update your SBMS directory to do the new right thing.

Conflicts

The guidance above is fine unless there are conflicts. There are two types of conflicts:

  1. The standard conflict: you have made changes on your branch and the master branch has different changes to the same file in the same section of code.
  2. The split-induced conflict: the split of sim-recon itself caused the conflict to occur. There are two sub-types.
    1. Your branch has changes to both recon directories and sim directories.
    2. Your branch has changes to the SBMS directory.

Case (1) is nothing new. You have to resolve it in the usual way.

Case (2.1) will occur when your branch has changes to both sim directories and recon directories. For example, you have made changes to a sim directory on the old branch and have checked out from the halld_recon repository. In this case the merge with the master would normally delete all sim files, but git notices you have changed some of these files and flags that situation as a conflict. You can resolve the conflict by performing a git rm on all of the flagged sim files and then perform the commit. Recall that those changes are present on the same branch in the halld_sim repository. And vice versa for recon changes checked out from halld_sim.

Case (2.2) will only be encountered by experts and they must rely on said expertise to resolve the situation.

Tags

Tags are tricker since merging to perform the update is not an option. To do a merge at all you have to create a branch from the tag, but if you merge in the master branch, that will bring in changes on the master and defeats the idea of a tag.

Here it is easiest to build the tag as-is, i. e., with a sim-recon-style build and use it that way. In other words, don't try to convert it.

There are ways to actually do the conversion, but if you need to do that see an expert.