Making old Patch set the current one

1,889 views
Skip to first unread message

Steffen Gebert

unread,
Mar 23, 2011, 6:44:11 PM3/23/11
to Repo and Gerrit Discussion
Hi,

I've made a mistake in Gerrit and need some help. I did the following:

* Pushed a commit for master branch
* Checked out released branch, cherry-picked the commit, but *forgot*
the remove the Change-Id
* Pushed the change to the released branch

The second push, of course, appears as Patch Set 2 and has as parent
the most recent commit of the released branch (so although Gerrit
still states "master", I assume merging will fail later after
submitting it).

I cannot push Patch Set 1 again, as Gerrit refuses it with "no new
changes". How can I get rid of the wrong Patch Set 2 or make Patch Set
1 the current one? Abandoning the change will totally close the issue,
I think. Ony way out?

Thanks
Steffen

Jay Soffian

unread,
Mar 24, 2011, 12:11:53 AM3/24/11
to Steffen Gebert, Repo and Gerrit Discussion
On Wed, Mar 23, 2011 at 6:44 PM, Steffen Gebert
<steffen...@googlemail.com> wrote:
> Hi,
>
> I've made a mistake in Gerrit and need some help. I did the following:
>
> * Pushed a commit for master branch
> * Checked out released branch, cherry-picked the commit, but *forgot*
> the remove the Change-Id
> * Pushed the change to the released branch
>
> The second push, of course, appears as Patch Set 2 and has as parent
> the most recent commit of the released branch (so although Gerrit
> still states "master", I assume merging will fail later after
> submitting it).

Gerrit will attempt to merge it to master.

> I cannot push Patch Set 1 again, as Gerrit refuses it with "no new
> changes". How can I get rid of the wrong Patch Set 2 or make Patch Set
> 1 the current one? Abandoning the change will totally close the issue,
> I think. Ony way out?

Abandon and push a new change, or just amend the original patch set
and re-push so it shows up as Patch Set 3.

j.

Steffen Gebert

unread,
Mar 24, 2011, 5:22:17 AM3/24/11
to Repo and Gerrit Discussion
Thanks for your fast reply, Jay.

> > I cannot push Patch Set 1 again, as Gerrit refuses it with "no new
> > changes". How can I get rid of the wrong Patch Set 2 or make Patch Set
> > 1 the current one? Abandoning the change will totally close the issue,
> > I think. Ony way out?
>
> Abandon and push a new change, or just amend the original patch set
> and re-push so it shows up as Patch Set 3.

Okay, now it worked. I just checked out Patch Set 1 and pushed it,
which was not accepted.

So I have to amend the commit and then I can push it again - even
without changing the commit message.
What's the reason? (just out of curiosity) Due to the changed time
stamp it gets a different SHA?

Thanks
Steffen

Magnus Bäck

unread,
Mar 24, 2011, 7:14:45 AM3/24/11
to Repo and Gerrit Discussion
On Thursday, March 24, 2011 at 10:22 CET,
Steffen Gebert <steffen...@googlemail.com> wrote:

> > Abandon and push a new change, or just amend the original patch set
> > and re-push so it shows up as Patch Set 3.
>
> Okay, now it worked. I just checked out Patch Set 1 and pushed it,
> which was not accepted.
>
> So I have to amend the commit and then I can push it again - even
> without changing the commit message.
> What's the reason? (just out of curiosity) Due to the changed time
> stamp it gets a different SHA?

Yes, the commit timestamp is included in the SHA-1 calculation. You can
see everything contributing to the commit identity with e.g.

git show -s --pretty=raw

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

Steffen Gebert

unread,
Mar 24, 2011, 10:38:18 AM3/24/11
to Repo and Gerrit Discussion
> Yes, the commit timestamp is included in the SHA-1 calculation. You can
> see everything contributing to the commit identity with e.g.
>
> git show -s --pretty=raw

Thanks a ton!

Steffen
Reply all
Reply to author
Forward
0 new messages