Using git-cherry-pick-upload to push to release branches?

41 views
Skip to first unread message

Rob Wu

unread,
Sep 11, 2015, 7:16:32 AM9/11/15
to infr...@chromium.org, sm...@google.com, iann...@chromium.org
Hi,

I'm looking for a way to land patches on release branches without checking out to that branch. Then I came accross git-cherry-pick-upload, which seemed like what I needed. So I started as follows, hoping that it would give the results equivalent to following the instructions of the git-drover man page:

git cherry-pick-upload  1db473b2e3b66646a7470e543540a44e854cd8f7 -b 2490

Unfortunately, this tool seems not maintained, used or tested, because the script throws an error when run (this is caused by an incomplete refactor at https://codereview.chromium.org/1075723002), which can be fixed by a small change to the cherry_pick function:
-  auth_config = auth.extract_auth_config_from_options
+  auth_config = auth.extract_auth_config_from_options(options)

The next problem is that the project is set to "chromium@2490" instead of "chromium". Well, after the following change, the project was correctly set:

-      ('project', '%s@%s' % (config('rietveld.project'), target_branch)),
+      ('project', config('rietveld.project')),

There are three more issues for which I haven't found a resolution yet, that's why I'm asking for some advice.

1. At this point, the CL created by the modified git_cherry_pick_upload.py script is identical to the result of the steps at the git-drover manual page (as seen at the codereview site), except for the "Target Ref". This should be refs/pending/branch-heads/2490, but it is not shown. The existing --target_ref logic in git_cl.py might be useful, but I didn't look into this.

2. Although the issue seems to be created successfully, the script still throws an error at line 126, where a request is sent to /<issue>/upload_complete/1 because the server replies with HTTP 405 (Method Not Allowed).

3. After going through the hassle of uploading the CL, I found that there is no way to use git cl land to land the CL, unless you check out to the branch from where the CL was created. This defeats the point of my efforts: I want to be able to land trivial patches on release branches without switching local branches.

Can these issues be resolved, and if yes, could the result be used to land patches on release branches? Or would it be less efforts to use the git-drover tool (WIP) at https://codereview.chromium.org/662113003/, referenced by crbug.com/404755#c23? (why is git-drover not in depot_tools yet?)

Kind regards,
 Rob
 https://robwu.nl

Primiano Tucci

unread,
Sep 11, 2015, 12:42:39 PM9/11/15
to Rob Wu, infr...@chromium.org, sm...@google.com, Robbie Iannucci
Cherry-pick upload will just create a rietveld CL.
I hope to be terribly wrong but I don't think today the commit-queue supports landing to release branches.

P.S. is checking out a branch an actual problem? once you have that in git (which you get by default these days) checkout and cherry-pick operation itself takes a bunch of seconds.
IMHO it's more about automating the workflow and making git-drover happen.

--
You received this message because you are subscribed to the Google Groups "infra-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to infra-dev+...@chromium.org.
To post to this group, send email to infr...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/infra-dev/CAA%2B18%3Dxaz%2B_CQYu2V8efqO3PerBMowa7%3DRVjU9MNDS%3D5Qxhq7A%40mail.gmail.com.

Ravi Mistry

unread,
Sep 11, 2015, 12:50:42 PM9/11/15
to Primiano Tucci, Rob Wu, infr...@chromium.org, Sana Muttaqi, Robbie Iannucci
On Fri, Sep 11, 2015 at 12:42 PM, Primiano Tucci <prim...@chromium.org> wrote:
Cherry-pick upload will just create a rietveld CL.
I hope to be terribly wrong but I don't think today the commit-queue supports landing to release branches.

 
Let me know if it does not work.

Primiano Tucci

unread,
Sep 11, 2015, 12:52:12 PM9/11/15
to Ravi Mistry, Rob Wu, infr...@chromium.org, Sana Muttaqi, Robbie Iannucci
^__^ I somehow missed that PSA. Ignore my comment at all then.

Rob Wu

unread,
Sep 14, 2015, 5:25:08 AM9/14/15
to Primiano Tucci, Ravi Mistry, Rob Wu, infr...@chromium.org, Sana Muttaqi, Robbie Iannucci
2015-09-11 18:52 GMT+02:00 Primiano Tucci <prim...@chromium.org>:
^__^ I somehow missed that PSA. Ignore my comment at all then.

On Fri, Sep 11, 2015 at 5:50 PM, Ravi Mistry <rmi...@chromium.org> wrote:


On Fri, Sep 11, 2015 at 12:42 PM, Primiano Tucci <prim...@chromium.org> wrote:
Cherry-pick upload will just create a rietveld CL.
I hope to be terribly wrong but I don't think today the commit-queue supports landing to release branches.

 
Let me know if it does not work.


P.S. is checking out a branch an actual problem? once you have that in git (which you get by default these days) checkout and cherry-pick operation itself takes a bunch of seconds.

I'm trying to avoid having to check out, because
1. That requires me to have a clean index (I cannot drop what I'm doing right now and switch branches (I could do git stash, but then my editor will warn about the file being changed)).
2. That changes all files, which requires a recompilation of everything (ccache reduces the pain, but still..).
3. Maintaining another repository (e.g. using git worktree) takes too much disk space.

All of the three issues I mentioned are not insurmountable, but a tool that allows easy backporting of patches would be very convenient.
 
IMHO it's more about automating the workflow and making git-drover happen.

Exactly. Why is git-drover development stalled?

Primiano Tucci

unread,
Sep 14, 2015, 5:46:39 AM9/14/15
to Rob Wu, Ravi Mistry, infr...@chromium.org, Sana Muttaqi, Robbie Iannucci

I'm trying to avoid having to check out, because
1. That requires me to have a clean index (I cannot drop what I'm doing right now and switch branches (I could do git stash, but then my editor will warn about the file being changed)).
2. That changes all files, which requires a recompilation of everything (ccache reduces the pain, but still..).
3. Maintaining another repository (e.g. using git worktree) takes too much disk space.

All of the three issues I mentioned are not insurmountable, but a tool that allows easy backporting of patches would be very convenient.

Yes, agree it all makes sense if the CQ supports landing into branches. I was just not aware of that.
Ignore my previous comments.

(just out of curiosity, I personally use btrfs and subvolume snapshots to avoid all the problems you mentioned, but no, I am not endorsing that for the general public and it is not a good reason for not having improvements like the one suggested here)
 
Reply all
Reply to author
Forward
0 new messages