"undo" a patch set

11,436 views
Skip to first unread message

br...@whamcloud.com

unread,
Jan 26, 2011, 12:19:16 PM1/26/11
to Repo and Gerrit Discussion
Let's say I erroneously pushed a patch update (i.e. same Change-Id: as
a previous push) and got Patch Set 2 from it. Can I roll back that
update to Patch Set 1?

I do notice the Abandon Change button but I suspect that will discard
the whole change, including both Patch Sets. That's throwing out the
baby with the bath water.

Any ideas?

Cheers,
b.

Magnus Bäck

unread,
Jan 26, 2011, 12:33:54 PM1/26/11
to Repo and Gerrit Discussion
On Wednesday, January 26, 2011 at 18:19 CET,
"br...@whamcloud.com" <br...@whamcloud.com> wrote:

> Let's say I erroneously pushed a patch update (i.e. same Change-Id: as
> a previous push) and got Patch Set 2 from it. Can I roll back that
> update to Patch Set 1?

You can't undo the upload of a patch set, but you can re-push the first
patch set and get a third patch set (identical to the first).

> I do notice the Abandon Change button but I suspect that will discard
> the whole change, including both Patch Sets.

Correct.

--
Magnus B�ck Opinions are my own and do not necessarily
SW Configuration Manager represent the ones of my employer, etc.
Sony Ericsson

Martin Fick

unread,
Jan 26, 2011, 12:51:14 PM1/26/11
to repo-d...@googlegroups.com, Magnus Bäck
On Wednesday 26 January 2011 10:33:54 am Magnus Bäck wrote:
> On Wednesday, January 26, 2011 at 18:19 CET,
>
> "br...@whamcloud.com" <br...@whamcloud.com> wrote:
> > Let's say I erroneously pushed a patch update (i.e.
> > same Change-Id: as a previous push) and got Patch Set 2
> > from it. Can I roll back that update to Patch Set 1?
>
> You can't undo the upload of a patch set, but you can
> re-push the first patch set and get a third patch set
> (identical to the first).
>
> > I do notice the Abandon Change button but I suspect
> > that will discard the whole change, including both
> > Patch Sets.
>
> Correct.

Yes, this can be annoying. I wrote an issue with a proposal
to mitigate these issues a while back:

http://code.google.com/p/gerrit/issues/detail?id=653

-Martin

Erik Pasternak

unread,
Jan 26, 2011, 12:55:54 PM1/26/11
to Martin Fick, repo-d...@googlegroups.com, Magnus Bäck
An easy way to repush your first patch set is:
1) go to the change in gerrit
2) expand the first patch set
3) click the 'copy to clipboard' button for a cherry-pick in the download section.
4) start a new branch
5) cherry pick the first patch set
6) commit it and make sure the commit message has the same Change-Id: line at the end
7) upload. This will create a new patch set on top of your previous change.

Reply all
Reply to author
Forward
0 new messages