PSA: git-drover is ready

89 views
Skip to first unread message

Sam McNally

unread,
Oct 6, 2015, 2:48:21 AM10/6/15
to chromium-dev, blink-dev
If you never merge changes to release branches you can stop reading now.

git-drover is ready to use for merging changes to release branches on Linux and Mac. To merge a revision to a branch, in your existing chromium checkout, run:
git drover --branch <branch_id> --cherry-pick <revision>
e.g. git drover --branch 9999 --cherry-pick b5a049

git-drover uses a new workdir so your existing build will be unaffected. See https://sites.google.com/a/chromium.org/dev/developers/how-tos/drover or run man git-drover for more details.

Scott Graham

unread,
Oct 6, 2015, 1:03:18 PM10/6/15
to Sam McNally, chromium-dev, blink-dev
Thanks Sam!

Avi Drissman

unread,
Oct 6, 2015, 1:05:33 PM10/6/15
to Sam McNally, chromium-dev, blink-dev
Whoo!

I have missed drover sooooo muuuuuch since the git transition. Thanks for the resurrection!

Avi

Chris Harrelson

unread,
Oct 6, 2015, 1:37:53 PM10/6/15
to Avi Drissman, Sam McNally, chromium-dev, blink-dev
This applies to Blink also, so I updated the doc to note that only old branches need special handling.




To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Jochen Eisinger

unread,
Oct 6, 2015, 2:32:05 PM10/6/15
to Chris Harrelson, Avi Drissman, Sam McNally, chromium-dev, blink-dev

What's the reason this doesn't work on Windows?

Scott Graham

unread,
Oct 6, 2015, 2:41:39 PM10/6/15
to Jochen Eisinger, Chris Harrelson, Avi Drissman, Sam McNally, chromium-dev, blink-dev
It symlinks a new fake git dir, which doesn't have built-in support in Python 2.

I uploaded a potential fix here, but haven't tested it yet as I don't have anything to back-merge at the moment.

Jeremy Roman

unread,
Oct 6, 2015, 3:16:44 PM10/6/15
to Scott Graham, Jochen Eisinger, Chris Harrelson, Avi Drissman, Sam McNally, chromium-dev, blink-dev
Why aren't --git-dir and --work-tree sufficient; is it actually necessary to make a symbolic link?

Primiano Tucci

unread,
Oct 7, 2015, 4:43:22 AM10/7/15
to Jeremy Roman, Scott Graham, Jochen Eisinger, Chris Harrelson, Avi Drissman, Sam McNally, chromium-dev, blink-dev
My $0.02
1) you can avoid any symlink by setting objects/info/alternate to the objects dir of the original repo, and then fetch the refs you need (Very likely just refs/branch-heads/NNNN and the commit to cherry-pick)
2) Considering that often cherry-picks in a release branch apply cleanly, you could have a fast-path in git-drover which generates the cherry-pick commit without needing any working directory at all. E.g., 
git reset branch-heads/2526
git show SHA1_to_cherrypick > /tmp/patch
git apply --cached /tmp/patch
git commit -m 'Cherry-pick of SHA1_to_cherrypick on top of branch-heads/2526"
At which point you could feed this to upload.py and let the CQ deal with the actual file operations, presubmits & landing.

Scott Graham

unread,
Oct 7, 2015, 8:00:41 PM10/7/15
to Primiano Tucci, Jeremy Roman, Jochen Eisinger, Chris Harrelson, Avi Drissman, Sam McNally, chromium-dev, blink-dev, Peter Kasting
I landed my direct port, so `git drover` might work on Windows now. I still haven't tried it, but Peter was feeling fearless and reports success.

(If it breaks and destroys your checkout, you can fix it by ... ... patching the code in depot_tools to be correct.)

Ryan Hamilton

unread,
Nov 23, 2015, 3:10:37 PM11/23/15
to Sam McNally, chromium-dev, blink-dev
Thanks for doing this! Alas, I tried this today, and seemed to hit a roadblock. On a new workstation that I recently set up, I seem to be unable to land the CL. Everything goes well until:

Fetching pending ref refs/pending/branch-heads/2564...
Cherry-picking commit on top of pending ref...
Pushing commit to refs/pending/branch-heads/2564... It can take a while.
Password for 'https://r...@chromium.org@chromium.googlesource.com': 
Push failed with exit code 128.
All attempts to push to pending ref failed.
Failed to push. If this persists, please file a bug.
Error: Command 'cl land --bypass-hooks' failed: Command '['git', 'cl', 'land', '--bypass-hooks']' returned non-zero exit status 1

I'm sure I've done something wrong, but I'm not sure what...?

Cheers,

Ryan

On Mon, Oct 5, 2015 at 11:47 PM, Sam McNally <sa...@chromium.org> wrote:

Ian Clelland

unread,
Nov 23, 2015, 3:34:43 PM11/23/15
to Ryan Hamilton, Sam McNally, chromium-dev, blink-dev
I hit this last week, and found enlightenment after running that command ("git cl land --bypass-hooks") in the dover temp directory.

In my case, I needed to generate a new auth token for googlesource.com, and the error message when I ran that command was explicit enough to point me in the right direction.

Ryan Hamilton

unread,
Nov 23, 2015, 3:50:56 PM11/23/15
to Ian Clelland, Sam McNally, chromium-dev, blink-dev
Hm, tried doing depot-tools-auth login https://chromium.googlesource.com and it appeared to work. Where is the drover temp directory that I might try running from?

Ian Clelland

unread,
Nov 23, 2015, 4:51:29 PM11/23/15
to Ryan Hamilton, Ian Clelland, Sam McNally, chromium-dev, blink-dev
When you run git drover, it creates a temporary directory (under /tmp/drover_XXXX, where XXXX is some number) to check out the changed files into.

I thought that the drover command always printed that directory out to the console, but I may have only seen it because I *also* had merge conflicts in my first commit.
The "merge with conflicts" example on http://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/git-drover.html shows the output that I saw, where it tells you the name of the temp directory.

Paweł Hajdan, Jr.

unread,
Nov 24, 2015, 6:40:36 AM11/24/15
to Ian Clelland, infr...@chromium.org, Ryan Hamilton, Sam McNally, chromium-dev, blink-dev
+infra-dev

Looks like it's git push that failed, which is not affected by depot-tools-auth.

If you go to https://chromium.googlesource.com/ , log in, follow "Generate Password" link and instructions there, does that help?

Paweł

Primiano Tucci

unread,
Nov 24, 2015, 6:53:48 AM11/24/15
to Ryan Hamilton, Sam McNally, chromium-dev, blink-dev
Looks like push is failing.
Did you ever setup your gitcookies (https://www.googlesource.com/new-password) to do direct "git cl land"?
Did you ever successfully merged something in release branches in the recent past (post SVN->Git migration) ?

There might be some ACL issue on the server side.
I've seen this in the past, people having ACLs to push to master but not for release branches.
Reply all
Reply to author
Forward
0 new messages