automatic rebasing?

266 views
Skip to first unread message

Anthony

unread,
Nov 18, 2009, 11:20:38 AM11/18/09
to Repo and Gerrit Discussion
It would be nice if Gerrit could automatically rebase changes when git
is able to. Frequently it says that a change failed be cherry-picked
because of a conflict, but git auto-merges with no problems.

Are there any limitations stopping this from happening?

Shawn Pearce

unread,
Nov 18, 2009, 11:24:36 AM11/18/09
to repo-d...@googlegroups.com
On Wed, Nov 18, 2009 at 08:20, Anthony <m.b...@gmail.com> wrote:
> It would be nice if Gerrit could automatically rebase changes when git
> is able to. Frequently it says that a change failed be cherry-picked
> because of a conflict, but git auto-merges with no problems.

I assume you have the project's submit action set to "Cherry Pick"?

> Are there any limitations stopping this from happening?

Yes. Currently JGit does not support content level merges within a
single file stream, therefore Gerrit also does not support this. A
patch series is being developed at the Eclipse Foundation to add diff
and merge functionality to JGit... but the series is still incomplete.
So basically its development effort.

Anthony

unread,
Nov 18, 2009, 11:57:07 AM11/18/09
to Repo and Gerrit Discussion
On Nov 18, 10:24 am, Shawn Pearce <s...@google.com> wrote:
> On Wed, Nov 18, 2009 at 08:20, Anthony <m.bn...@gmail.com> wrote:
> > It would be nice if Gerrit could automatically rebase changes when git
> > is able to. Frequently it says that a change failed be cherry-picked
> > because of a conflict, but git auto-merges with no problems.
>
> I assume you have the project's submit action set to "Cherry Pick"?

We do for almost all of our projects. This seems to be the most
convenient except for with branches trying to merge up to mainline
(which requires switching the submit action, but I think there is
already an issue logged for this).

>
> > Are there any limitations stopping this from happening?
>
> Yes.  Currently JGit does not support content level merges within a
> single file stream, therefore Gerrit also does not support this.  A
> patch series is being developed at the Eclipse Foundation to add diff
> and merge functionality to JGit... but the series is still incomplete.
>  So basically its development effort.

I see. Do users there normally just do a `git checkout <branch> && git
rebase <master name> && repo upload --replace .`? I seem to type that
pretty frequently. It probably would be too unknown and confusing to
add a repo command for this...

I mostly noticed this because I just made a script to do automatic
changes, so I had about 50 changesets up and then had to rebase a
dozen of them.

Shawn Pearce

unread,
Nov 18, 2009, 12:08:29 PM11/18/09
to repo-d...@googlegroups.com
On Wed, Nov 18, 2009 at 08:57, Anthony <m.b...@gmail.com> wrote:
> On Nov 18, 10:24 am, Shawn Pearce <s...@google.com> wrote:
>>
>> Yes.  Currently JGit does not support content level merges within a
>> single file stream, therefore Gerrit also does not support this.  A
>> patch series is being developed at the Eclipse Foundation to add diff
>> and merge functionality to JGit... but the series is still incomplete.
>>  So basically its development effort.
>
> I see. Do users there normally just do a `git checkout <branch> && git
> rebase <master name> && repo upload --replace .`? I seem to type that
> pretty frequently. It probably would be too unknown and confusing to
> add a repo command for this...

Yup. Actually, we tend to use Change-Id lines and just let Gerrit do
the change matching, rather than relying on upload --replace to handle
it.

> I mostly noticed this because I just made a script to do automatic
> changes, so I had about 50 changesets up and then had to rebase a
> dozen of them.

Use Change-Id ? :-)
Reply all
Reply to author
Forward
0 new messages