Me and my team are developing a feature using a remote branch (origin/our_feature_branch
) off of main track (origin/dev
). Gerrit is used for review etc.
Uplifting the remote branch is done with git merge origin/dev
followed by fixing conflicts, committing and git push origin HEAD:refs/for/our_feature_branch
.
Gerrit enforces a rule saying that only one commit at a time can be pushed. I cannot do anything about this.
Say I start working on doing an uplift:
git fetch
git checkout -b uplift origin/our_feature_branch
git merge origin/dev
But here I get stuck fixing some conflicts and the regression tests take some time to run, and some team member submits another commit to the feature branch in Gerrit. This commit is now on top of the base commit for my "ongoing" uplift.
What do I do now?
If I rebase my merge commit on the feature branch I remove the merge and add all commits merged in from origin/dev
on top of it - not an option. If I merge with the feature branch I will end up with a merge on a merge and I will end up having to push two commits to Gerrit - also not allowed.
Is there a solution to this or do I have to re-do the merge and try to remember to tell everyone that we have a delivery stop next time I start working on an uplift?