Gerrit Cherry Pick Adds Patch Set

238 views
Skip to first unread message

Curtis Spencer

unread,
Feb 14, 2011, 2:14:41 AM2/14/11
to Repo and Gerrit Discussion
Hi,

I have been evaluating Gerrit for the past week or so. Everything has
been going smoothly, except I have one thing that has been giving me
some difficulties.

I am trying to keep a linear branch history for a development branch.
When a user submits up for a code review, I cherry pick the patch down
on to a pristine development branch. If everything patches cleanly, I
do a push of that cherry picked patch (with a new sha1 that cherry
picking generates, but the same Change-Id in the commit message.
Then, when people fetch the development branch, they also see a clean
linear history. The only downside of this approach that I see so far
is in the code review, this generates an additional Patch Set (that is
unreviewed) for a particular change-id. This results in confusion
when looking at the code review because the new patch set is
unreviewed, even though the changeset is actually pushed into the
development branch.

Is there a way to only generate one Patch Set if the cherry pick +
push succeeds and there is no change in the patch that is cherry
picked?

Thanks,
Curtis

Shawn Pearce

unread,
Feb 14, 2011, 10:21:00 AM2/14/11
to Curtis Spencer, Repo and Gerrit Discussion

Not currently. This is a long-standing bug/feature-request to copy the
approvals from a prior patch set when the patch itself hasn't changed
but was rebased onto a different parent. We still want to generate the
new patch set, so the actual version that was applied can be reviewed
later, but we also want to show it was approved in a prior form.

Luciano Carvalho

unread,
Feb 14, 2011, 10:54:52 AM2/14/11
to Shawn Pearce, Repo and Gerrit Discussion, Curtis Spencer

You seem to be doing exacts what the cherry-pick submit type does.
Why don't you simply use Gerrit to do what you're doing manually?

Curtis Spencer

unread,
Feb 14, 2011, 4:17:04 PM2/14/11
to Luciano Carvalho, Shawn Pearce, Repo and Gerrit Discussion
On Mon, Feb 14, 2011 at 7:54 AM, Luciano Carvalho <lsca...@gmail.com> wrote:
> You seem to be doing exacts what the cherry-pick submit type does.
> Why don't you simply use Gerrit to do what you're doing manually?

Luciano,

How does Gerrit do this automatically while maintaining a linear commit history?

Thanks,
Curtis

Curtis Spencer

unread,
Feb 14, 2011, 4:22:44 PM2/14/11
to Shawn Pearce, Repo and Gerrit Discussion
> Not currently. This is a long-standing bug/feature-request to copy the
> approvals from a prior patch set when the patch itself hasn't changed
> but was rebased onto a different parent. We still want to generate the
> new patch set, so the actual version that was applied can be reviewed
> later, but we also want to show it was approved in a prior form.
>

Shawn,

Thanks for the info about the feature-request. As it stands is this
considered a valid way to use Gerrit if one desires linear commit
history or is there a better way?

Thanks,
-Curtis

Magnus Bäck

unread,
Feb 14, 2011, 4:27:58 PM2/14/11
to Repo and Gerrit Discussion
On Monday, February 14, 2011 at 22:17 CET,
Curtis Spencer <tho...@gmail.com> wrote:

> On Mon, Feb 14, 2011 at 7:54 AM, Luciano Carvalho <lsca...@gmail.com>
> wrote:
>
> > You seem to be doing exacts what the cherry-pick submit type does.
> > Why don't you simply use Gerrit to do what you're doing manually?
>
> Luciano,
>
> How does Gerrit do this automatically while maintaining a linear
> commit history?

When configured to cherry-pick changes when they're submitted, Gerrit
cherry-picks the most recent patch set onto the tip of the branch. By
definition this creates a linear commit history.

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

Reply all
Reply to author
Forward
0 new messages