views:

53

answers:

1

Lets say for the sake of argument that we don't care much about history.

If I have a master branch that is being updated somewhat often and I have a shared topic branch that is rather long lived, will regularly merging master-> topic branch (and resolving conflicts as they arise) allow for a smooth merge of the topic branch -> master later on?

+2  A: 

What you're saying sounds uncontroversial - if you regularly merge (backport) changes from the main branch into a side branch, then, when the time comes to merge your side branch back into the main, you won't have as much work to do.

Of course, right? Over time, your branches diverge. And how you write your code today depends on how you wrote it yesterday. The more your branches have diverged today, the more they will diverge tomorrow.

Say that in the main branch you refactor some code. Say that in the side branch you have to implement a new feature that uses the code that was refactored. If you write that new feature before you merge (backport) the refactoring changes, then, when you want to port the new feature to the main branch, you will either have to a) add back into main the pre-refactored code or b) refactor the new feature. Whereas if you had already merged (backported) the refactoring, your new feature can be merged into main without all that work.

Ladlestein