gclient sync when not at git HEAD

780 views
Skip to first unread message

Matt Perry

unread,
Mar 11, 2013, 9:32:03 PM3/11/13
to chromium-dev
I'm trying to do a bisect to track down a regression, but whenever I run gclient sync at a revision that is not HEAD, I get the following error:

# gclient sync                                                                  
1>_____ src at refs/heads/master
Error: Switching upstream branch from refs/remotes/origin/git-svn to refs/remotes/origin/master
Please merge or rebase manually:
cd /usr/local/google/home/mpcomplete/src/schrome/src; git rebase refs/remotes/origin/master
OR git checkout -b <some new branch> refs/remotes/origin/master

I don't want to be at origin/master - I want to be on a previous revision. How do I check out an earlier revision?

Thanks!

Yoyo Zhou

unread,
Mar 11, 2013, 9:39:24 PM3/11/13
to Matt Perry, chromium-dev
This worked for me (I can't remember where I found it in the
documentation, but it was difficult):

gclient sync -r src@HEAD

Yoyo Zhou

Daniel Cheng

unread,
Mar 11, 2013, 9:41:25 PM3/11/13
to y...@chromium.org, Matt Perry, chromium-dev
You can also switch to using unmanaged gclient by setting "managed": False in your src solution. The difference between unmanaged and managed gclient is that gclient sync doesn't automatically mess around with src/chromium/src. I prefer this since I'm often working in a branch and I don't want the automatic rebasing behavior of managed gclient. YMMV.

Daniel


--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
    http://groups.google.com/a/chromium.org/group/chromium-dev




Matt Giuca

unread,
Mar 11, 2013, 11:56:51 PM3/11/13
to dch...@chromium.org, y...@chromium.org, Matt Perry, chromium-dev
This worked for me (I can't remember where I found it in the
documentation, but it was difficult):
gclient sync -r src@HEAD

I've tried gclient sync -r src@REVISION_I_WANT in the past, but I always get errors (something to do with git rebase) whenever I use it. I have never successfully managed to go back to a historical revision of Chrome. I'm not sure what gclient sync -r src@HEAD will achieve, but perhaps it makes sense with managed: False...

On 12 March 2013 12:41, Daniel Cheng <dch...@chromium.org> wrote:
You can also switch to using unmanaged gclient by setting "managed": False in your src solution. The difference between unmanaged and managed gclient is that gclient sync doesn't automatically mess around with src/chromium/src. I prefer this since I'm often working in a branch and I don't want the automatic rebasing behavior of managed gclient. YMMV.

I haven't tried setting managed: False. Maybe that will fix it.

As far as I'm aware, setting managed: False means that gclient sync will not mess with your main git repo, but will only ensure that the third-party dependencies are up-to-date. So if I'm understanding this, I should:

1. Set managed: False.
2. Use regular git reset --hard commands to get back to a revision of my choosing.
3. Use gclient sync -r src@HEAD, which will update all of the third-party dependencies to match git's HEAD (which is whichever revision I just jumped to).

Does that sound about right?

Dana Jansens

unread,
Mar 12, 2013, 12:00:50 AM3/12/13
to mpcom...@chromium.org, chromium-dev
On Mon, Mar 11, 2013 at 6:32 PM, Matt Perry <mpcom...@chromium.org> wrote:
I use this with git:

gclient sync -r <gitcommithash>

eg. gclient sync -r 14dc9d7104c0cc299c096ab1f8d8552ae422e73a
 

Thanks!

Matt Perry

unread,
Mar 14, 2013, 1:51:44 PM3/14/13
to Dana Jansens, chromium-dev
Doh - I had forgotten about managed mode. gclient sync -r <git-hash> worked. Thanks all!
Reply all
Reply to author
Forward
0 new messages