Changing destination branch

709 views
Skip to first unread message

robi...@e2eservices.co.uk

unread,
Jan 27, 2016, 5:25:54 AM1/27/16
to Repo and Gerrit Discussion
Hi,

I've recently made a couple of mistakes in sending a change for review on the wrong remote branch, previously im sure i could just push the change again to the other branch but i get a "No changes made" error and cannot see a way via the Web UI to change the destination branch. Cannot rebase to the head of the other branch to change it either.

The only way i've found to do it is to generate a new Change-ID and re-submit it.

I couldn't see anything obvious in the permissions to allow me to change the destination branch, is there a way to do this?

Thanks,
Robin

Stefan Beller

unread,
Jan 27, 2016, 6:31:57 PM1/27/16
to robi...@e2eservices.co.uk, Repo and Gerrit Discussion
Cherry-pick should work?
> --
> --
> To unsubscribe, email repo-discuss...@googlegroups.com
> More info at http://groups.google.com/group/repo-discuss?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Repo and Gerrit Discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to repo-discuss...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

David Pursehouse

unread,
Jan 27, 2016, 8:16:12 PM1/27/16
to Stefan Beller, robi...@e2eservices.co.uk, Repo and Gerrit Discussion
On Thu, Jan 28, 2016 at 8:31 AM 'Stefan Beller' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:
Cherry-pick should work?


If the workflow is something like:

git checkout origin/master
make one or more commits
git push origin HEAD:refs/for/stable  <-- accidentally to the wrong branch

I'm not sure that cherry-picking (locally) to master and pushing again will work because the commit at the bottom of your series is still going to have the same parent and author, and Gerrit will reject with "no changes made". Same as when you try to just push the same series of commits to the correct branch.

Cherry-picking (to a new change) on the UI might work, but you still end up with changes that you have to abandon (i.e the ones on the wrong branch).

In this situation having a "change the destination branch" feature would be very useful.  There was work ongoing [1] to implement it, but it has been abandoned.

robi...@e2eservices.co.uk

unread,
Jan 28, 2016, 3:25:36 AM1/28/16
to Repo and Gerrit Discussion, sbe...@google.com, robi...@e2eservices.co.uk
Cheers for the replies,

This issue is as the David said (or at least similar), i have two branches in Gerrit for the same project and have a tendency (as i use Eclipse) to push to the wrong branch, i end up abandoning the change and re-generating the change-id to be able to push it to the correct branch. Not an ideal solution and if i get some time will have a look at the moveChange as it might be quite useful for me :)

Robin

Nasser Grainawi

unread,
Feb 11, 2016, 1:55:56 PM2/11/16
to robi...@e2eservices.co.uk, Repo and Gerrit Discussion, sbe...@google.com
Soon as I get some spare time I'll pick it back up. Only a handful of code review comments to address, it works though. You'd also probably want some kind of UI. I think there's a change up that adds a SSH command, but nothing that adds a button to the web UI.

Nasser
-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, 
a Linux Foundation Collaborative Project

Reply all
Reply to author
Forward
0 new messages