Skip to main content
Blog

Rebase your branch in the Software Factory

Rebase your branch in the Software Factory
Mark Jongeling
Administrator
Forum|alt.badge.img+23

When working with the Software Factory, often times you create a Feature branch to process your changes in, verify the result, and thereafter merge it into the Origin branch. Robert-Jan made an excellent blog about how the Manage branches with Thinkwise which I recommend reading.

Developing new features can lead to branches being open for a long time. It may be that the feature is postponed, or just very big. A variety of reasons can lead to a branch being open for multiple months on end. Once the time has come for the Branch to be merged with the Origin, the merge session wil perform a difference analysis and show you all the differences between when the branch was created and now. That impact may be significantly large.

With such big impact, it can be difficult to determine the merge session will result in the exact model you desire. You already have the option to first merge the Origin into the Branch to have all the ongoing developments added to your branch. Once done, the branch has all the latest developments of the Origin, and all your additions of the Branch.

As of writing, this merge essentially means that you perform all the Origin actions very fast in your Branch. If right after you that would perform a merge from Branch to Origin, the difference analysis part would still look at all changes between the Branch's creation and now. That impact is now even larger than before. Luckily, all conflicts that result in both the Origin and the Branch having the same object with the same values are automatically resolved. So you do not have to resolve it manually.

But here's the thing

Currently, the Origin model version, the moment in time where the branch either was created or the last reciprocal merge was performed, is not updated when merging from Origin to Branch. This means that all differences from branch creation or reciprocal merge until the moment of merging are examined. The more actions, the more impact.

One unintended side-effect that I have seen through your tickets is that object can "reappear” so to speak.

Imagine two branches Origin and Branch. You personally work in Branch and your colleages have been merging their innovations to Origin. You are getting ready to finish your work, but you do want to test your additions with the additions of your colleagues, so you perform a Origin → Branch merge, updating your branch.

Your branch now contains all the added tables, columns, prefilters, functionality and so on.

If another merge takes place changing the Origin which, for example, removes tables that have been added previously to your Branch, your upcoming merge session from Branch to Origin will re-introduce those removed tables again.

Why is that?

The origin model version is used to determine the start of the branch, and therefore the state of the model at that point is used to see which objects where added, updated, and deleted.

For simplicity, I’ll use ABC to resemble objects in the model.

  • The Blue boxes are model states where objects are either added or removed
  • The Green line resembles the Delta - the difference analysis considers all actions done between the origin model version and the current point-in-time
  • The stripped blue arrows are merge sessions
B added via Origin → Branch merge     removed in Origin     B and A added via Branch → Origin merge

Now you can see, it's like you have created object in your branch. Object B is going to be added in the Origin as the difference analysis only sees the differences.

How to resolve this?

We will be updating the origin model version once you merge the Origin to your Branch, essentially Rebasing the Branch.

Now, the following will happen when merging from Origin to Branch:

B added via Origin → Branch merge     B removed in Origin     Only A added via Branch → Origin merge

Now the difference analysis notices that object B has been removed in the Origin, so the addition will not be performed. Object B will not be present in the Origin after your merge session. Awesome!

However… We need your input

We determined we will need to say goodbye to a feature that you may use. The ability to Archive branch manually at a later point in time. This merge strategy will no longer be available when you merge your non-protected branch to the origin.

Similar to described before, actions can be missed completely due to the difference analysis using the origin model version to determine the creation or last update moment. Even an later update merge session from the origin to the branch will not help.

Let's use continue the example above:

First merge:

B added via Origin → Branch merge     B removed in Origin     Only A added via Branch → Origin merge

Second merge:

This time after the previous merge from Branch → Origin, the object A was removed in the branch. We will now perform another Branch → Origin merge.

First merge A was added    Second merge A remains to exist in Origin

The delete action of object A is not seen as a change, and will therefore have no effect in the merge session.

And this is just with one object, this can happens to every other object you modify or remove in your branch.

This is a serious problem, and the way to resolve this is by requiring the branch to be either archived, or be reciprocally merged. 

Question: Do you Archive branch manually at a later point in time after merging it?

Concluding

I'm looking forward hearing from you all! We want to give you the best experience when merging and sometimes have to make tough choices.  In the future, we want to make Merging similar to Pull requests, allowing you to review and approved changes in the merge session itself. 

Forum|alt.badge.img+5

Do you Archive branch manually at a later point in time after merging it?

No, for feature branches we always create a new (clean) branch after merging or we use reciprocal merge. 

 

For me this is a no-brainer, the origin model version needs to be updated! It is way too dangerous to keep te current behaviour as you have described in this blog. We have encountered multiple problems after updating a feature branch ourselves and because of that we changed our policy to never update it anymore. So changing this would be very welcomed!


J. de Lange
Hero
Forum|alt.badge.img+4

We do sometimes archive branches later, but we can definitely live without the feature if that solves all the trouble we have been having with this current merge behavior. I’m glad to see you working on this!


Forum|alt.badge.img+6

We don’t use the option for archive branch at later point in time. So no issue to remove that option.
Hope this will resolve several issues we currently are facing with the merging, like renamed functionality / variables etc are still there after a merge.


Arjan Sollie
Thinkwise blogger
Forum|alt.badge.img+14

@Mark Jongeling 

The only reason why I would like to manually archives branches is because in some cases performing the merge leads to a result which was not expected. In that case I need to go back to the feature branch and check how it was configured there and manually copy this to the trunk. I am not sure whether or not this is still possible when a branch is archived automatically, if so, then there is no reason to keep the manual option at the moment.


Forum|alt.badge.img+14

Yes, I do use manually archiving my branch sometimes. I'm not working in the merged branch anymore, but I use it to be able to start the application based on my branch (SF) model and database in the development environment.  


Forum|alt.badge.img+5

@Mark Jongeling would it also be an option to leave ‘Archive branch manually at a later point in time’ possible, but make the branch protected and not selectable in the merge task (preferably with some kind of message that the branch already has been merged)? 

This would make the uses of ​@Arjan Sollie and ​@Andre te Raa still possible. And it would also solve the situation when someone used the ‘Unarchive branch’ task.

 


Mark Jongeling
Administrator
Forum|alt.badge.img+23

@PeterKeeris ​@Arjan Sollie ​@Andre te Raa, it is certainly a way we could support. The exact issue is indeed the branch being re-merged, not the branch itself. If we implement a way to define which branch may or may not be merged, it would indeed solve both needs 😄

Exact terminology and how it would be visible is up for debate. Feel free to leave your ideas as a reply here.

I would say indeed a message when attempting to merge it, or we could opt to filter out the branch so it cannot be chosen. In the Model overview > Branches screen, a visual indication should also be present I think. Perhaps even in the Branch diagram similar to how archived branches and protected branches are presented.


Freddy
Forum|alt.badge.img+16
  • Thinkwise Local Partner Brasil
  • April 15, 2025
PeterKeeris wrote:

Do you Archive branch manually at a later point in time after merging it?

No, for feature branches we always create a new (clean) branch after merging or we use reciprocal merge. 

 

For me this is a no-brainer, the origin model version needs to be updated! It is way too dangerous to keep te current behaviour as you have described in this blog. We have encountered multiple problems after updating a feature branch ourselves and because of that we changed our policy to never update it anymore. So changing this would be very welcomed!

Same here. The described issue happened recently again in one of our projects. 

Definitely looking forward to improvements in that area. Even perhaps an admin option to in case of emergency to manually set a point in time further away to fix any potentially missed objects. 


Mark Jongeling
Administrator
Forum|alt.badge.img+23

So from what I read, several Community members would like the option to keep the merged branch and leave it as-is. We can certainly keep supporting that. The merged branch will be in a state where the branch is Finalized.

This state indicates the branch was merged to its Origin, is no longer in development, cannot be reopened or become un-finalized, and cannot be merged again, but can be archived at a later time.

We'll ensure the Model overview > Branches screen shows this state properly, and add a visual indication in the Branch diagram. The old merge strategy will be renamed and will show the merged branch will become finalized and cannot be merged again. The Archive branch merge strategy will also make the branch finalized in case the branch becomes unarchived.

Thank you all for your swift response and feedback!


Ionut
Vanguard
Forum|alt.badge.img+2
  • Vanguard
  • April 17, 2025

As someone already said above, we are usually creating new branches for the features. Mostly we use reciprocal merge, when we need changes from our colleagues, we make sure that we have a stable version and get it by reciprocal merge. 

We did a few times merges from origin to feature, but this caused some problems and some unexpected conflicts, so that's why we avoid doing that.

The removal of archive branch later point in time will not affect us, will be nice to have the process improved as it's described in the post.


K.Bakkenes
Captain
Forum|alt.badge.img+9

No, I personally don't use this option. In our branch structure we are mostly required to do reciprocal merges. 
Branch structure:

  • MAIN
    • BETA
    • ALPHA
      • DEV_TEAM_1
        • FEATURE_1
        • FEATURE_2
      • DEV_TEAM_2

Only the FEATURE_# branches could be archived later, but must of the time we archive them automatically.

We do have feature branches which remain below a DEV_TEAM_# branch for too long and can't be released yet. These branches get updated from time to time with a merge from a DEV_TEAM_#  (Update branch). After a while the merge conflicts grow larger and larger with each merge and you'll get the same conflicts over and over again. All because the origin model version never changes.
So when we decide the feature is ready to be released we consider if it's worth the trouble to perform a merge to origin. In a lot of these situations we just create a fresh branch from the latest DEV_TEAM_# model version and copy all our changes manually from the feature branch to the freshly created branch.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings