We have almost settled for a branching model where we have a master
branch which represents the production code and a release-x.x
branch that represents future releases.
However, there are a few scenarios we are unsure how to solve effectively:
Live bug fix is not relevant for the current release
A new
feature
is branched of therelease-2.0
and does a complete re-write of module A.The new
feature
is completed and merged inrelease-2.0
.A bug in the current live module A is found and fixed on
master
.
At this point we figured there are 2 possible scenarios:
We rebase
release-2.0
onmaster
to bring bug fixes and fix conflicts (discarding the bug fix code which is now irrelevant). Eventually we then mergerelease-2.0
inmaster
when the release is ready.We cherry-pick only the bug fixes that are relevant to the release into
release-2.0
and when the release is ready we override the entiremaster
history with therelease-2.0
history.
Solution #1 forces us to resolve merge conflicts with commits we know aren't needed, but solution #2 forces us to wipe the entire master
branch and replace it by the release-2.0
branch's history on every release. That introduces a slight chance of losing bug fixes we forgot to cherry-pick on release-2.0
and could also break ongoing bug fixes that were branched of master
before the release.
A feature doesn't make it into the release afterall
- We create a new
feature
, rebase onrelease-2.0
and merge it intorelease-2.0
with--no-ff
. - A few bugs are found so we fix them on
feature
and redo the above merge process. - Clients review the feature once again a decides they wants to change many things -- the feature has no value without these things, but we cannot make these changes for the
release-2.0
and will have to wait untilrelease-3.0
.
What is the proper way to deal with that scenario? Should we revert all commits related to the feature that were done in release-2.0
with a message such as "Revert feature X - pushed back to 3.0" and then later merge feature
to release-3.0
?