Brief overview
We are product company and we are providing solutions to more than 50 clients and they are growing each month and we have fairly simple branching model which I would like to upgrade if possible.
The model
We are doing agile therefore we have sprints and releases. Each month or two we are opening new release branch from master which will be stabilized and later will be given to clients that are interested in features in it. So far so good. During development new clients are created. Let's say we start working on a client A and we decide that this client will go with certain version, let's say release/1.0 so we make branch release/A_1.0 and we start our development there, once we are done we merge release/A_1.0 -> release/1.0 and we deploy to production from release/1.0 branch this client.
Before I continue to explain where the problem is I will set some rules that we are keeping:
- Once
releasebranch is openmasteris never merged there. release/{client}_{version}branches are occasionally updated withrelease/{version}branch (version numbers should match).- Only
hotfixbranches are merged intorelease/{version}branch. - Before opening new
release/{version}branch 2-3 previous versionreleasebranches are merged tomasterso all the hotfixes from these previous versions are in the new version as well. - Hotfixes from previous version are not allowed once
release/{version}branch is opened.
Where is the problem?
Tbh problem is bad planning, but this happens and it can't be avoided. Let's say we negotiated with a client(B) and we decided to give them version 1.0, that would be opening a branch making it release/B_v1.0 while we are developing this client in this branch time goes by and our product team sprint opens another release, for instance 1.1.Sometimes development process of client takes enough time for product to open if not one but two or three new release/{version} branches. So if this happens management and the client might decide to go live with newer version(let's say 1.3 - previously it was developed for 1.0). Now what it has to be done is that we need to open branch from release/1.3 for this client and then merge previously opened branch - that would be making merge release/B_1.0 --> release/B_1.3 and this can be PAINFUL to be done. Why?
Because
release/B_1.0is occasionally updated withrelease/1.0this means that all hotfixes from version 1.0 will be inrelease/B_1.0(this can't be avoid as some hotfixes are crucial to development of the client) and when it comes time to mergerelease/B_1.0 --> release/B_1.3this will include all these hotfixes from version 1.0 inrelease/B_1.3and later whenrelease/B_1.3 --> release/1.3merge is introduced they will be included in version 1.3 which is forbidden.
What I do in situations like this?
I cherry-pick all commits/merges, that were in release/B_1.0 and are not hotfixes that came from release/1.0, into release/B_1.3 but this can be really time consuming and mistakes can be made also due to the fact how git history works.
I proposed that these client branches can be locked for committing so only merges goes in there and when this kind of merge can be made I can easily cherry-pick only the merges from relevant branches(ignoring merges from release/{version}) and not worry about leaving trailing commits, but this means that everyone working in this branch has to make his own branch and merge it in it which kinda slows the development process in my opinion.
Do you have any other suggestions that would ease such merges?