Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A Gerrit patchset depends on a outdated patchset

Tags:

git

gerrit

enter image description here

What i have done:

  1. push a patch to gerrit
  2. make a tag
  3. push tags
  4. admin user merge this patch to master

i cannot find any answer for this problem. And the most important thing is this patch depends on itself.

like image 522
OmniBug Avatar asked Jul 23 '26 05:07

OmniBug


1 Answers

The problem:

Your change (CHANGE-2) depends on another (CHANGE-1) but the patchset (commit) of the CHANGE-2 used as the base for CHANGE-1 is outdated. In other words: somebody (or the Gerrit itself) created a second patchset for the CHANGE-1 and now CHANGE-2 is depending on a patchset that will never be integrated (merged) to the branch.

You have something like this:

BASE --- CHANGE-1_PATCHSET-1 --- CHANGE-2_PATCHSET-1
  \
   \--- CHANGE-1_PATCHSET-2

You need to rebase CHANGE-2 to have something like this:

BASE --- CHANGE-1_PATCHSET-1 --- CHANGE-2_PATCHSET-1
  \
   \--- CHANGE-1_PATCHSET-2 --- CHANGE-2_PATCHSET-2

Depending on your Gerrit version and the changes (if you will have conflicts or not) you can do this easily using the Rebase button on Gerrit UI. If you have an old Gerrit version or you find conflicts you'll need to execute the "git rebase" manually (something like: git rebase CHANGE-1_PATCHSET-2_commit.

like image 100
Marcelo Ávila de Oliveira Avatar answered Jul 24 '26 21:07

Marcelo Ávila de Oliveira