Whenever I sent a review to Gerrit and if the review is pending for some time, I am getting cannot merge
message in Gerrit.
I understood its coming because somebody else would have changed same file/files and delivered before me. I am trying below workaround to solve my issue.
This works but the review comments whatever I had would no longer be available and it is difficult for my reviewer to check it again.
I am looking for a way to remove cannot merge
from current review. Thanks!
In some cases, it is possible to resolve merge conflicts issues in Gerrit using simple rebase triggered directly from the Gerrit UI. Just click on "Rebase" button to rebase the change. The behaviour is described in Gerrit Review UI: If the rebase is successful, a new patch set with the rebased commit is created.
To do that, you click the “Submit” button in the Gerrit Web UI just as you would click the “Merge Pull Request” button in GitHub. Both, Gerrit and GitHub, allow different merge strategies, that can be enabled by project administrators.
Rebasing. Rebasing is usually the last step before pushing changes to Gerrit; this allows you to make the necessary Change-Ids. The Change-Ids must be kept the same. squash: mixes two or more commits into a single one. reword: changes the commit message.
Use git mergetool to run one of several merge utilities to resolve merge conflicts. It is typically run after git merge. If one or more <file> parameters are given, the merge tool program will be run to resolve differences on each file (skipping those without conflicts).
You do NOT need to abandon the current change on Gerrit to solve the "cannot merge" issue. All you need to do is:
Try rebase
button, which can solve most cannot-merge issues. If it can find the proper commit to rebase onto by itself, it's okay. If it cannot, find the last commit of the target branch and fill in the commit blank. Sometimes you should first submit the commit, on which the cannot-merge one has dependency. If it cannot work anyhow, just abandon it and make the commit based on the latest commit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With