Re: Unable to Rebase

1,556 views
Skip to first unread message

Saša Živkov

unread,
Aug 9, 2012, 10:01:47 AM8/9/12
to Hack, repo-d...@googlegroups.com
On Thu, Aug 9, 2012 at 10:28 AM, Hack <chandr...@valyoo.in> wrote:
> Hi all,
>
> One of my developers pushed a merge commit.After verification and review I
> submitted the patch.
>
> But due to some dependency the status of the commit is "Submitted merge
> pending".It says that one of the merged commit in the dependencies is
> outdated.I tried to rebase my merge commit but gerrit is giving an error
> that my commit is based on many patches.

How did you try to rebase the merge commit? Using Gerrit's Rebase button?
Gerrit cannot rebase a merge commit.

>
> Due to this we are not able to merge the code.
>
> Please help!!
Rebase the merge commit in your local Git repository,
then push the new (rebased) merge commit.

>
>
> Thanks,
> KC.
>
> --
> To unsubscribe, email repo-discuss...@googlegroups.com
> More info at http://groups.google.com/group/repo-discuss?hl=en

Magnus Bäck

unread,
Aug 9, 2012, 10:09:10 AM8/9/12
to repo-d...@googlegroups.com
On Thursday, August 09, 2012 at 04:28 EDT,
Hack <chandr...@valyoo.in> wrote:

> One of my developers pushed a merge commit.After verification and
> review I submitted the patch.
>
> But due to some dependency the status of the commit is "*Submitted
> merge pending*".It says that one of the merged commit in the
> dependencies is * outdated*.I tried to rebase my merge commit but
> gerrit is giving an error that my commit is based on many patches.
>
> Due to this we are not able to merge the code.

Please be more specific about what you've done and what messages you get
from Gerrit (and Git, where applicable). Don't paraphrase messages. It's
for example not clear what the "based on many patches" error message you
speak of comes from because there is no Gerrit message with that wording.

Specific questions:

- Is it really a merge commit the developer has uploaded? If so, why?
While it sometimes makes sense to upload merge commits (like when
you merge two branches), it's fairly unusual and chances are you're
doing something you shouldn't be doing (like using "git pull"
rather than "git pull --rebase").
- How did you rebase the commit?
- Did you verify that the rebase was correct, i.e. is the commit
now based on the most recent commit on the destination branch?

--
Magnus Bäck
ba...@google.com

Chandramouli Kollipara

unread,
Aug 13, 2012, 7:19:53 AM8/13/12
to repo-d...@googlegroups.com
Sorry here is the problem.

-- One of the developers pushed a merge commit.
-- Commit was verified and the patch was submitted but the status of the commit says "submitted but not merged".

This was the exact message.

Change cannot be merged due to unsatisfiable dependencies.

The following dependency errors were found:

  • Depends on patch set 1 of Idfbf027b, however the current patch set is 2.

Please rebase the change and upload a replacement commit.


-- I tried to rebase it using the "Rebase" button but this was the error


Application error

Server Error


The patch set you are trying to rebase is dependent on several other patch sets: [com.google.gerrit.reviewdb.client.PatchSetAncestor@5b5df0, com.google.gerrit.reviewd



-- I tried to resolve this error "Depends on patch set 1 of Idfbf027b, however the current patch set is 2" by trying to make patchset 1 the current patch set.This is the procedure I followed.

  • I did a checkout of a patch 1 ,did an amend of patch set 1 and committed it.
  • I merged the new branch on to master branch and pushed it to gerrit.
  • Verfied and submitted it.

               Even after doing this my problem is not resolved.



Magnus Bäck

unread,
Aug 13, 2012, 9:37:14 AM8/13/12
to repo-d...@googlegroups.com
On Monday, August 13, 2012 at 07:19 EDT,
Chandramouli Kollipara <chandr...@valyoo.in> wrote:

> Sorry here is the problem.
>
> -- One of the developers pushed a merge commit.
> -- Commit was verified and the patch was submitted but the status of the
> commit says "*submitted but not merged*".

[...]

> -- I tried to resolve this error "*Depends on patch set 1 of Idfbf027b,
> however the current patch set is 2"* by trying to make patchset 1 the
> current patch set.This is the procedure I followed.
>
> - I did a *checkout of a patch 1* ,did an amend of patch set 1 and
> committed it.
> - I merged the new branch on to master branch and pushed it to gerrit.
> - Verfied and submitted it.
>
> Even after doing this my problem is not resolved.

If a change has a dependency to an obsolete patch set, the only way to
solve it is to rebase your change. Short if mucking around in the Gerrit
database, there is no way to recover patch set 1 of a change if there
already is a patch set 2. The dependency in your change is to the exact
commit of patch set 1. Short of submitting that exact commit, the
dependency will persist.

Now, since your change is a merge commit your best bet would be to redo
the merge onto the tip of the branch (or onto the most recent patch set
of an open change, but as you've already discovered this complicates
matters). Or, as I suggested earlier, chances are the merge commit
shouldn't be a merge commit in the first place.

--
Magnus Bäck
ba...@google.com
Reply all
Reply to author
Forward
0 new messages