views:

43

answers:

1

We are currently reworking a big part of our code base. We choose to create a separate branch for this since the rework will take several months and we should be fixing bugs and updating the default with new features in the meantime. Obviously we want our rework branch not drift away from the default too much.

We decided to merge the default into the rework branch once every month. This should solve our problem and save us from a hell of a merge after a couple of months when we want to merge our rework branch in the default.

Today we merged the default for the second time in our rework branch (2 months passed since the start of the rework), but I noticed something strange during the merge. It seems like the merging we did the first time (a month ago), we had to do it again today. If so, then we aren't winning any time with merging every month and we could as well postpone it to the end of the rework. But is my assumption right: if I merged the default into a branch and after some time again I merge the default again in that branch, it doesn't matter if I merged it the first time? The work for the second merge stays the same, we could as well leave the branch alone and do a big merge in the end?

+1  A: 

What makes you think the first merge "didn't work"?

The second merge will only have to "merge" the delta between where default is now and where it was when the first merge occurred.

Also depending on the amount of work being done in both branches, I would say that merging once a month is a very long time period to keep the branches out of sync.

As a side note, if you want to keep the history prettier, you could just rebase instead of constantly merging (keep in mind that if the rework branch is being pushed/pulled, it's a no-go).

Idan K
The drawback to using rebase is that you lose the merge information, which is work too. Your history should reflect what actually happened ("merged in monthly") not what you wish happened ("all this work was done after all the work on the mainline").
Ry4an
Rebasing is indeed not an option as we are working on the rework branch with different people.Why I think my merge did't work the first time, is that while merging the second time I had to manually solve conflicts in parts of the code that weren't touched in the rework branch since the first merge. However, we did change that part of the code extensively before the first merge and had to solve conflicts during that merge too.But maybe I'm just imaging things... but that was the feeling I got during that second merge. We'll see what happens during the third merge then.
Tiftof