Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » I must work with submodules - How can I change branches?(My project includes submodules - I don't know how to work with it at all.)
I must work with submodules - How can I change branches? [message #719789] Mon, 29 August 2011 03:18 Go to next message
Joerg
Messages: 6
Registered: August 2011
Junior Member
Hi guys,

I use EGit (released with Indigo) to commit and push to a project.
This project has submodules, which currently are not properly supported by EGit.

However, I want to work with the rest of the project, meaning with the code, which is not in a submodule.

This creates a severe problem:

How can I checkout another branch?
When I go to Team > Switch To and choose a branch I always get the message:
"The files below have uncommited changes, which would be lost when checking out ... Please either add the changes to the repository by creating or amending a commit with these changes or dispose these changes by resetting your current HEAD."
Then follows a list of the folders with the submodules.

I do not want to have these folders in a following commit and resetting HEAD also does not help (it creates the same situation again).

I only want to change the branch, nothing else.
How can I do that?
Re: I must work with submodules - How can I change branches? [message #721459 is a reply to message #719789] Thu, 01 September 2011 20:00 Go to previous messageGo to next message
Joerg
Messages: 6
Registered: August 2011
Junior Member
Ahh, come on guys!

Any clue? I am not the only one with this problem, am I?

I currently always delete the whole project and clone the repository again. This is time consuming and cumbersome.
Re: I must work with submodules - How can I change branches? [message #721524 is a reply to message #719789] Fri, 02 September 2011 01:36 Go to previous messageGo to next message
Dariusz Luksza is currently offline Dariusz Luksza
Messages: 40
Registered: July 2010
Member

As long as JGit don't have support for submodules EGit will also don't support it. So please be patient Wink or contribute submodules support to JGit and then I can ensure you that EGIt will also support it Wink. This is how things works here ...
Re: I must work with submodules - How can I change branches? [message #721555 is a reply to message #721524] Fri, 02 September 2011 05:59 Go to previous messageGo to next message
Joerg
Messages: 6
Registered: August 2011
Junior Member
Thanks for your response!

I know how Open Source development works - that's what I need EGit for. Wink

But back to the problem:
I also tried to add the folders with the submodules to .git/info/exclude. However, they are not ignored.
I still get the error message.

[Updated on: Fri, 02 September 2011 06:01]

Report message to a moderator

(no subject) [message #721897 is a reply to message #721555] Sat, 03 September 2011 12:41 Go to previous messageGo to next message
Robin Rosenberg is currently offline Robin Rosenberg
Messages: 331
Registered: July 2009
Senior Member
Joerg skrev 2011-09-02 07.59:
> I know how Open Source development works - that's what I need EGit for. ;)

You do not need submodules to fix EGit :)

> But back to the problem:
> I also tried to add the folders with the submodules to
> .git/info/exclude. However, they are not ignored.
> I still get the error message.

Submodules does not work (yet) so few people know exactly how it will fail..

We fixed cloning because of a bug report and no-one has reported any
other problems so far. One could argue that ignoring submodules is the
proper thing to do.

I added a bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=356664

-- robin
Re: (no subject) [message #722184 is a reply to message #721897] Mon, 05 September 2011 01:09 Go to previous messageGo to next message
Joerg
Messages: 6
Registered: August 2011
Junior Member
Hi Robin,

thanks for creating the report.

Do you need more information about the problem?
If so, please tell me, how I can get them!

Jörg

[Updated on: Mon, 05 September 2011 18:46]

Report message to a moderator

Re: (no subject) [message #722384 is a reply to message #722184] Mon, 05 September 2011 15:15 Go to previous messageGo to next message
Robin Rosenberg is currently offline Robin Rosenberg
Messages: 331
Registered: July 2009
Senior Member
Joerg skrev 2011-09-05 03.09:
> Hi Robin,
>
> thanks for creating the report.
>
> Do you need more information about the problem?
> If so, please tell me, how I can get them!
>
> Jörg

Grab the patches, build and test.
The Contributor's guide in the Wiki has all the
details.

I did not write unit tests, maybe you could...

-- robin
Re: (no subject) [message #722430 is a reply to message #722384] Mon, 05 September 2011 18:45 Go to previous messageGo to next message
Joerg
Messages: 6
Registered: August 2011
Junior Member
Hi Robin,

I am no Java developer, but I'll try to test your patches.

Thanks a lot!

Apart from what you already fixed, there still is one case, which could need improvement:
When a submodule pointer was updated and you try to pull, EGit currently produces an error ("Checkout conflicts"). Pulling then does no longer work; you always again get this error message.
It would be nice, if this error would not block pulling completely, so that you could still synchronize your project and go on working with it.

Jörg
Re: (no subject) [message #722455 is a reply to message #722430] Mon, 05 September 2011 20:13 Go to previous messageGo to next message
Robin Rosenberg is currently offline Robin Rosenberg
Messages: 331
Registered: July 2009
Senior Member
Joerg skrev 2011-09-05 20.45:
> Hi Robin,
>
> I am no Java developer, but I'll try to test your patches.
>
> Thanks a lot!
>
> Apart from what you already fixed, there still is one case, which could
> need improvement:
> When a submodule pointer was updated and you try to pull, EGit currently
> produces an error ("Checkout conflicts"). Pulling then does no longer
> work; you always again get this error message.
> It would be nice, if this error would not block pulling completely, so
> that you could still synchronize your project and go on working with it.

Regarding submodules, there are a a lot of things to fix.... The patches
to include a fix to ignore conlicts in submodules on checkout. Maybe it
solves your problem.

-- robin
Re: (no subject) [message #724184 is a reply to message #722455] Sun, 11 September 2011 09:28 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias Sohn
Messages: 594
Registered: July 2009
Senior Member
Robin's patches have been submitted. So you may try the latest nightly available at http://download.eclipse.org/egit/updates-nightly and check if it fixes your problem
Re: I must work with submodules - How can I change branches? [message #728917 is a reply to message #719789] Sat, 24 September 2011 11:17 Go to previous message
Joerg
Messages: 6
Registered: August 2011
Junior Member
Thanks for the Info, Matthias!

I have tried the SR1 release and EGit 1.1.
Well, submodules still do not work, but(!) changing branches and even updating submodule pointers is working without an error now. Before, this broke everything so that I had to redownload the whole repository.

That's what I call a good start!

Thank you, guys!

PS: And I just saw that there already is a patch in Gerrit, which adds submodule support. It becomes even better. Smile

[Updated on: Sat, 24 September 2011 12:28]

Report message to a moderator

Previous Topic:Git Staging 1.1
Next Topic:Merge tool
Goto Forum:
  


Current Time: Fri Oct 31 14:27:38 GMT 2014

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

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