Submit a changeset to Gerrit based on another user change

I’ve submited another change to CyanogenMod project that add the “Delete application” menu to the “Developer Option” advanced menu (link to gerrit)

An user has requested an edit to a file in order to change the string displayed in the setting application, and initially I’ve thought that the change was related to my submit (but after I realized that is another CM project…)

BTW the question is: “How to amend a commit that another user has previously changed with another changeset not in my working copy?” (…a little bit obscure….)

For example, the commit status on Gerrit is:

  • Patchset 1 : author Sarbyn
  • Patchset 2 : author Sarbyn
  • Patchset 3 : author Sarbyn
  • Patchset 4 : author XYZ

My working copy is on patchset 3 and I need to submit a change about patchset 4.

Solution

The steps are:

  • git stash
  • click on the checkout-link in Download on the right patch set and copy&paste the git command in your working copy
  • git stash pop
  • Edit the file
  • git commit –amend and keep the Change-Id the same