Pushing the wrong tree into gerrit

96 views
Skip to first unread message

Simon Wilkinson

unread,
Aug 10, 2009, 3:27:56 PM8/10/09
to repo-d...@googlegroups.com
I just had a slightly embarrassing moment where I managed to get the
command line for a git push to gerrit confused, and pushed one project
into the gerrit instance of a different one. Sadly, that results in a
change being created in the second project's gerrit for every commit
in the first project, leading to much embarassment, and clicking of
the abandon button.

Is there any way of getting to gerrit to check that the changes being
pushed actually have a common ancestor with the repository they are
being pushed to before accepting them? Or do I just have to be more
careful in future?

Cheers,

Simon.

Shawn Pearce

unread,
Aug 10, 2009, 3:41:15 PM8/10/09
to repo-d...@googlegroups.com

There currently isn't a "common ancestry check", but it might not be
too hard to add one to Receive.java. In fact, its probably a good
idea, pushing a new history which has no common ancestor to the
destination is usually a mistake. If you *really* wanted to do that,
you could work around it by creating a merge commit which contains the
two distinct histories, and upload that merge commit for review, and
thus still have something in common with the destination project.

Patches would be appreciated. :-)

Shawn Pearce

unread,
Aug 20, 2009, 11:59:17 AM8/20/09
to repo-d...@googlegroups.com
On Mon, Aug 10, 2009 at 12:41, Shawn Pearce<s...@google.com> wrote:
> On Mon, Aug 10, 2009 at 12:27, Simon Wilkinson<si...@sxw.org.uk> wrote:
>>
>> I just had a slightly embarrassing moment where I managed to get the
>> command line for a git push to gerrit confused, and pushed one project
>> into the gerrit instance of a different one. Sadly, that results in a
>> change being created in the second project's gerrit for every commit
>> in the first project, leading to much embarassment, and clicking of
>> the abandon button.
>
> There currently isn't a "common ancestry check", but it might not be
> too hard to add one to Receive.java.

Check added in https://review.source.android.com/11267, will be in .19.

Simon Wilkinson

unread,
Aug 20, 2009, 12:25:41 PM8/20/09
to repo-d...@googlegroups.com

On 20 Aug 2009, at 16:59, Shawn Pearce wrote:

>
> Check added in https://review.source.android.com/11267, will be in .
> 19.

Thanks for finding the time to implement that - greatly appreciated.

Cheers,

Simon.

Reply all
Reply to author
Forward
0 new messages