Gerrit Change has Status:Submitted, Merge Pending, how to solve it?
Asked Answered
A

7

18

The Gerrit system is only used by us several people. Once there is a Change A, and its status is: "Submitted, Merge Pending". The change list in the "open" web page. Also I noticed this Change had a dependency on another change B (which status is abandoned).

  1. How to make A listed on "Merged" web page ?
  2. How to make B disappear, so A has no more dependency on B ?
Ageless answered 5/1, 2012 at 3:38 Comment(1)
I've asked similar question and got a bit more detailed (useful for newbie) answers.Beaverboard
O
25

If change A has a dependency on B, then A cannot be merged until B is merged. Since you have abandoned B, Gerrit will not automatically merge A.

What you will need to do is modify A (perhaps using git rebase) so that it no longer depends on B, and resubmit the change to Gerrit.

Obeisance answered 5/1, 2012 at 3:40 Comment(4)
Then how to make B disappeare from web page ?Ageless
You've already abandoned B. What else do you want to do with it?Obeisance
@GregHewgill I think what he meant was how to delete change B entry from Gerrit as if it never existed(so it does not show on Gerrit Web UI anywhere). I don't think it is possible from Gerrit Web UI as there is a Restore Change button on Abandoned change items which lets you bring a change back from abandoned state. If one still wanted to delete they could do so manually from backend(although I never tried it)Busload
Suggestion: Try a rebase origin/branch by the pending commit owner.Suite
G
2

FYI. I had the same problem of "Submitted, Merge Pending" when user press submit twice on same page (she double clicked the submit button). It happened in Gerrit 2.11.

Error in log looks like

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:     Duplicate entry '5173-2-1' for key 'PRIMARY'
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

Before submitting there was only 1 commit (code changes). But after double pressing there are 2 commits. Second one is with new Commit Message and "Submitted, Merge Pending" status.

When I removed all information about second commit:

$ ssh -p 29418 admin@machine gerrit gsql
gerrit> delete from `patch_set_approvals` where change_id=5173 and patch_set_id=2;
gerrit> delete from `patch_set_ancestors` where change_id=5173 and patch_set_id=2;
gerrit> delete from `patch_sets` where change_id=5173 and patch_set_id=2;

it marked as integrated by user Gerrit Code Review .

Goldshlag answered 18/5, 2015 at 13:37 Comment(0)
B
1

What Greg states is correct, an automatic merge is not possible. It is possible to incorporate just A by using Gerrit's "cherry pick" option (essentially a manual merge). Unfortunately, this will not remove the "Merge Pending" status of Gerrit. I usually write a comment to this effect, if the Contributor cannot be troubled to rebase.

Biologist answered 9/1, 2013 at 21:2 Comment(0)
D
1
  1. Abandon your push from Gerrit.

On Terminal:

  1. git log
  2. git reset HEAD~n

where n is the commit count from top in list of commits generated on terminal from step 2

  1. git add .
  2. git commit -m "Your message"
  3. git push

now merge your commit on Gerrit.

Donyadoodad answered 10/6, 2017 at 18:22 Comment(0)
F
0

Guy. If you commit has a tag, you may meet a bug. This bug had been fixed in Gerrit V2.7.

Bug reference: https://groups.google.com/forum/#!topic/repo-discuss/tLVMibfzroc

Frau answered 15/11, 2013 at 8:43 Comment(0)
S
0

I had the same problem of "Submitted, Merge Pending" without any dependency or conflict. Quick fix is to go through all open items and see if there is any other commit in "Submitted, Merge Pending" status. If yes, just abandon them all.

Then git commit --amend -m "your original comments" and git push again, this time you can have your fix merged.

Stratopause answered 27/2, 2015 at 19:19 Comment(0)
A
0

I faced this issue because I pushed a tag to branch name:

git tag x.y.z HEAD
git push -f origin x.y.z:master

So better push a branch instead,

git tag x.y.z HEAD
git push -f origin HEAD:master

That way gerrit is able to merge again my pending patches.

Anecdote answered 7/12, 2016 at 7:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.