Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Buckminster » Git checkout appears to get wrong branch
Git checkout appears to get wrong branch [message #737092] Fri, 14 October 2011 16:46 Go to next message
Matthew Webber is currently offline Matthew WebberFriend
Messages: 198
Registered: December 2010
Senior Member
I'm materializing a CQuery that resolves to serveral Git repositories, as well as some components from Subversion, p2 (for the target platform) etc.

All the Git repositories have "master" and a single branch called "1.0.0". After materialization, all the Git repositories are on branch "1.0.0".

There are no advisor nodes to specify the branch, so I would have expected them to have "master" checked out. Note that this is with a fresh clone that Buckminster has made.

Any ideas as to why this is?

Thanks
Matthew
Re: Git checkout appears to get wrong branch [message #737100 is a reply to message #737092] Fri, 14 October 2011 16:54 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3232
Registered: July 2009
Senior Member
That sounds odd. Is the repository public so that I can try it out?

- thomas

On 2011-10-14 18:46, Matthew Webber wrote:
> I'm materializing a CQuery that resolves to serveral Git repositories,
> as well as some components from Subversion, p2 (for the target platform)
> etc.
>
> All the Git repositories have "master" and a single branch called
> "1.0.0". After materialization, all the Git repositories are on branch
> "1.0.0".
>
> There are no advisor nodes to specify the branch, so I would have
> expected them to have "master" checked out. Note that this is with a
> fresh clone that Buckminster has made.
>
> Any ideas as to why this is?
>
> Thanks
> Matthew
>
Re: Git checkout appears to get wrong branch [message #737103 is a reply to message #737100] Fri, 14 October 2011 16:58 Go to previous messageGo to next message
Matthew Webber is currently offline Matthew WebberFriend
Messages: 198
Registered: December 2010
Senior Member
No, sorry, it's not public. And I'm about to go off on holidays for 2 weeks. I'm presuming that it's an error on my part somewhere, and was hoping that someone coudl suggest where that might be.

Does Buckminster explicity checkout "master" once it's cloned the repository?
icon4.gif  Re: Git checkout appears to get wrong branch [message #789070 is a reply to message #737103] Thu, 02 February 2012 15:18 Go to previous messageGo to next message
Matthew Webber is currently offline Matthew WebberFriend
Messages: 198
Registered: December 2010
Senior Member
I have worked out how to reproduce this, and have a public repository that illustrates the problem.

I think it's a bug in either EGit or JGit. The underlying problem appears to be that EGit (or possibly JGit) checks out the most recently updated branch, rather than the default branch. If no branch is specified by Buckminster, the EGit/JGit can check out a non-default branch and pass it to Buckminster.

I and have posted about this on the EGit forum (see http://www.eclipse.org/forums/index.php/m/789057/#msg_78905), with instructions on how to reproduce it.

It you want to reproduce it using Buckminster, you can

  1. Start Eclipse (with Buckminster installed) pointing to a fresh workspace.
  2. Make the "Git Repositories" view visible.
  3. Open the CQuery at http://www.opengda.org/buckminster/base/bug-demo.cquery
  4. Hit "Resolve and Materialize"

Note that the repository is cloned pointing to branch 1.0, even though master is the default (and what git clone gives you).

Matthew
Re: Git checkout appears to get wrong branch [message #789085 is a reply to message #789070] Thu, 02 February 2012 15:33 Go to previous messageGo to next message
Matthew Webber is currently offline Matthew WebberFriend
Messages: 198
Registered: December 2010
Senior Member
I just noticed that there might be a Buckminster problem as well.

To my advisor node in the CQuery, I added a Branch/Tag path: of main. My assumption was that Buckminster would tell EGit/JGit that it wanted the master branch. However, I still got the 1.0 branch.

Does main mean anything in the Git context?

Matthew
Re: Git checkout appears to get wrong branch [message #789698 is a reply to message #789085] Fri, 03 February 2012 09:38 Go to previous message
Matthew Webber is currently offline Matthew WebberFriend
Messages: 198
Registered: December 2010
Senior Member
This bug will be fixed in EGit 1.3 (the fix is already available in the EGit nightly repository, see the thread on the EGit forum for details).
Matthew
Previous Topic:Mini-Tutorial: Fetching, archiving and re-using a target platform with Buckminster/Hudson
Next Topic:feature/plugin versions
Goto Forum:
  


Current Time: Mon Dec 22 16:30:46 GMT 2014

Powered by FUDForum. Page generated in 0.02163 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software