Jump to content

Fat branches (combined merges) and subtractive merge


Stephen Taylor

Recommended Posts

Hi,

There appears to be a few different ways to create something we call a fat branch (see attached image).

This is when you are trying to merge your branch into another branch and it gets combined with a merge from another changeset in that branch since you weren't synced with the head of the branch when you merged.

e.g

1. You are in main but not at the head. You do a merge from a different branch then checkin. You will see a dialog which will tell you there have been changes main to the branch you are in and do you want to merge with them. If you say OK then it will merge them in and submit to create a fat branch.

2. This can also happen if you do a merge to a branch and someone else does this at the exact same times. This is a server side merge but also creates a fat branch.

3. It will even happen if you are in a branch but not at the head and get latest from the same branch and submit. This happens a lot when people thing they are in their branch and get latest from main but were actually already in main.

The problem this presents is should the merge to main break the build then we need to do a subtractive merge.  This will effectively revert the changeset we merged to main and also revert the other merge changes that ended up getting combined into the fat branch (we didn't want it to do this).

So my question is, what is that best way to handle this situation?

Cheers,

Stephen.

 

fatBranchSmall.PNG

Link to comment
Share on other sites

Sorry for not coming back to you earlier, but the forum didn't work for a few hours today, we complained to the provider already and had to run an upgrade (ouch!).

 

Now, onto your question: yes, what you describe can certainly happen if concurrent merges happen on the same branch. How often does that happen? Well, really depends a lot on the team. My recommendation is to stick to something as follows:

 

https://www.plasticscm.com/book/#_a_perfect_workflow

 

So, basically, merges to main are done by the CI/CD system (or one of our mergebots - http://blog.plasticscm.com/2018/09/add-mergebot-to-your-repo.html) and nobody elses touches main.

 

Not sure if I was very helpful, feel free to dig in deeper :)

 

pablo

Link to comment
Share on other sites

  • 1 month later...

Hi Pablo,

Thank you for your reply but this doesn't really help.

Even if merges to main are only done by CI/mergebot there are other situations that these fat branches occurs in other non-main branches.

Do you have any plan to fix their creation or suggestion as to how to prevent them?

If they occur we can no longer back out one change set as they all become atomically linked.

Cheers,

Stephen.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...