PSA: fetch chromium now uses git unmanaged mode

1,243 views
Skip to first unread message

Paweł Hajdan, Jr.

unread,
Aug 22, 2013, 7:03:54 PM8/22/13
to chromium-dev
TL;DR: 'fetch chromium' now uses git unmanaged mode

If you’re using a Chromium git checkout using instructions from https://code.google.com/p/chromium/wiki/UsingGit, this change may affect you. There are important changes related to having “managed” and “unmanaged” checkout modes.

In the Chrome Infrastructure team we’ve come to the conclusion that managed mode was actually a bad idea. It was supposed to be an easier workflow for people new to git, but it turned out to be full of surprising behaviors. The unmanaged mode is actually more consistent and predictable, and the document mentioned above has been updated to strongly recommend unmanaged mode.

The main difference is that with the managed mode local branches track local master branch instead of origin/master, and gclient “manages” the branches so that they stay in sync. In practice this leads to a situation where there are two master branches (local master and origin/master) that go out of sync and prevent further uploads/commits. With the unmanaged mode you always have only one master: origin/master. The local master still exists but is not treated in any special way by the tools.

The change I just made today is that the “fetch chromium” command will use the unmanaged mode. I also recommend everyone using managed mode to switch to unmanaged mode by editing the .gclient file and changing “managed”: True to “managed”: False.

Paweł

Jeffrey Yasskin

unread,
Aug 22, 2013, 7:06:35 PM8/22/13
to Paweł Hajdan, Jr., chromium-dev
In unmanaged mode, is the instruction at
https://code.google.com/p/chromium/wiki/UsingGit#Updating_the_code
still true? If not, could you change it until it is?
> --
> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev

Paweł Hajdan, Jr.

unread,
Aug 22, 2013, 8:07:41 PM8/22/13
to Jeffrey Yasskin, chromium-dev
AFAIK the instructions are correct. Here's an example of my gclient sync with unmanaged mode on a local branch:

D:\src\chromium-git\src>gclient sync

_____ src at refs/heads/master
Error: 1> Background task requires input. Rerun gclient with --jobs=1 so that
1> interaction is possible.

D:\src\chromium-git\src>gclient sync --jobs=1

_____ src at refs/heads/master
Cannot fast-forward merge, attempt to rebase? (y)es / (q)uit / (s)kip :

It actually updated origin/master and rebased the current branch on top of it (and also synced DEPS).

Paweł

Adam Barth

unread,
Aug 22, 2013, 10:10:30 PM8/22/13
to Paweł Hajdan, Jr., Jeffrey Yasskin, chromium-dev
Does this change affect "fetch blink" as well?

Adam

Paweł Hajdan, Jr.

unread,
Aug 23, 2013, 5:49:15 PM8/23/13
to Adam Barth, Jeffrey Yasskin, chromium-dev
Yes I think it does - "fetch blink" appears to also use chromium recipe.

I'm going to send a similar PSA to blink-dev.

Paweł

Paweł Hajdan, Jr.

unread,
Aug 23, 2013, 9:04:35 PM8/23/13
to Jeffrey Yasskin, chromium-dev
Actually Jeffrey, my previous test was invalid (it was done on a managed checkout by mistake).

With unmanaged checkout you need git pull --rebase or just git pull and then gclient sync.

I've updated the docs to reflect that. There may be further updates.

If there is more discussion about the instructions and getting them right, please fork a separate thread - this was a PSA, you can continue using managed mode for now, just the default for new checkouts has been switched.

I appreciate how these announcements have been received and I'm working on your questions and feedback.

Paweł

Jeffrey Yasskin

unread,
Aug 25, 2013, 8:03:43 PM8/25/13
to Paweł Hajdan, Jr., Jeffrey Yasskin, chromium-dev
On Fri, Aug 23, 2013 at 6:04 PM, Paweł Hajdan, Jr.
<phajd...@chromium.org> wrote:
> Actually Jeffrey, my previous test was invalid (it was done on a managed
> checkout by mistake).
>
> With unmanaged checkout you need git pull --rebase or just git pull and then
> gclient sync.
>
> I've updated the docs to reflect that. There may be further updates.

Thanks for double-checking. Before making this sort of change in the
future, could you and the rest of the infrastructure team go over the
instructions and update them to match the new state of the world?

Paweł Hajdan, Jr.

unread,
Aug 26, 2013, 1:34:38 PM8/26/13
to Jeffrey Yasskin, chromium-dev
I agree this could be better reviewed, will remember to do that.

Thank you for feedback.

Paweł

Daniel Bratell

unread,
Aug 28, 2013, 6:00:42 AM8/28/13
to chromium-dev
Den 2013-08-23 01:03:54 skrev Paweł Hajdan, Jr. <phajd...@chromium.org>:

> TL;DR: 'fetch chromium' now uses git unmanaged mode

Which I like. The managed gclient did a little too much magic for my taste.

But there are still places in the documentation that needs updating.

http://code.google.com/p/chromium/wiki/UsingGit#Managing_src.git_yourself

says:

"WARNING: The following workflow is UNSUPPORTED. If you need support, do
not use it."

And doing what it says about keeping in sync:

gclient recurse -s git git fetch --all

will result in python errors (at least for me on my Windows machine; might
be something I've broken locally).

/Daniel

Paweł Hajdan, Jr.

unread,
Dec 2, 2013, 8:05:38 PM12/2/13
to Daniel Bratell, chromium-dev
Just to close the loop here, new instructions are at https://sites.google.com/a/chromium.org/dev/developers/how-tos/get-the-code

Please report any inaccuracies.

Paweł


Thiago Farina

unread,
Dec 6, 2013, 10:33:17 PM12/6/13
to Paweł Hajdan, Jr., Daniel Bratell, chromium-dev
Pawel,

My blink checkout does not sync anymore.

my .gclient looks like:

solutions = [
{
u'managed': True,
u'name': u'src',
u'url': u'https://chromium.googlesource.com/chromium/src.git',
u'custom_deps': {},
u'deps_file': u'.DEPS.git',
u'safesync_url': u'',
u'custom_vars': {u'webkit_rev': u''}
}]

My dumb script that I use to sync does just:

$ gclient sync --reset --manually_grab_svn_rev --force
--delete_unversioned_trees

It is stuck at:

________ running 'git reset --hard HEAD' in '/home/tfarina/blink/src'
HEAD is now at 357af72 SVN changes up to revision 239063

--
Thiago

Thiago Farina

unread,
Dec 6, 2013, 10:46:52 PM12/6/13
to Paweł Hajdan, Jr., Daniel Bratell, chromium-dev
I followed the instructions:

Switched from Managed to Unmanaged mode (sigh! will have to train my
memory muscles again and edit my toy scripts).

cd "$CHROMIUM_DIR" && git pull origin master
cd "$BLINK_DIR" && git pull origin master
gclient sync

It is syncing now. I will report back if something else appears.
--
Thiago
Reply all
Reply to author
Forward
0 new messages