Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Setup with multiple repositories
Setup with multiple repositories [message #655475] Mon, 21 February 2011 10:18 Go to next message
Kay Huber is currently offline Kay HuberFriend
Messages: 36
Registered: July 2009
Member
Hi all

I'm trying to do a somewhat special (e)git setup:
We have a (java) product that is split into parts like "platform", "core" and "ui". For each part, we have a number of OSGi bundles which have a naming concept applied - e.g.
* com.mycompany.platform.*
* com.mycompany.core.*
* com.mycompany.ui.*

Since some parts (e.g. platform) can / should / will be reused in other products, we want to have them in separate git repos.

Now most of us developers want / have to develop on all three parts at once. That is: I'm having one eclipse workspace with all bundles checked out.
At first I was quite confident that git is able to reflect such a setup, but after some experimentation I'm getting some doubts.

Does anybody have experience with such or similar setups?
Any tips and tricks / best practices?

Thanks & Regards
Kay
Re: Setup with multiple repositories [message #655485 is a reply to message #655475] Mon, 21 February 2011 11:30 Go to previous messageGo to next message
Manuel Doninger is currently offline Manuel DoningerFriend
Messages: 119
Registered: October 2010
Senior Member
In my company we use a similar configuration with 7 separate repositories, all of them contain some projects, and we used some technical and functional characteristics to create that structure.

What exactly are your doubts?

[Updated on: Mon, 21 February 2011 11:31]

Report message to a moderator

Re: Setup with multiple repositories [message #655494 is a reply to message #655485] Mon, 21 February 2011 13:01 Go to previous messageGo to next message
Kay Huber is currently offline Kay HuberFriend
Messages: 36
Registered: July 2009
Member
Hi Manuel

That sounds promising Smile

I have some questions:
* Do you work mainly with command line git or egit in that setup?

If egit is used:
* How did you start?
Most user guides about git I found so far were like "you can start by creating 'one' local repo or you can clone a remote one". My case is like: I'd like to start with at least three (two remote, one local), how can I connect them properly?
I tried, but had a number of strange issues on egit (I tried to report most of them assuming they were limitations or possibly bugs...)

* I didn't try yet: Is it possible to create a topic branch in the local repo like "feature X" that virtually spans over all remote repos? (Like if I want to add a feature that affects platform, core and ui at the same time).
If this is possible, how can I push that branch - and all projects affected - to the respective remote repositories?
The most exciting thing I could imagine is, that the topic branch "feature X" is created in all remote repos but in all repos only covers the projects existing there (only platform projects in platform repo etc.)

* When adding a new project, do you have to manually configure the correct remote (upstream?) repo? Is that feasible? I mean: Don't the developers tend forget to do or do a wrong configuration from time to time, thus having projects ending up in wrong repos or not in remote repos at all?

* I noticed, that with egit it's currently impossible to remove projects (project removal cannot be committed - except with command line git) - did you just never remove projects?
(see https://bugs.eclipse.org/bugs/show_bug.cgi?id=337577)

Thanks for any throughts or hints regarding these questions...
Regards
Kay
Re: Setup with multiple repositories [message #655529 is a reply to message #655494] Mon, 21 February 2011 15:36 Go to previous messageGo to next message
Manuel Doninger is currently offline Manuel DoningerFriend
Messages: 119
Registered: October 2010
Senior Member
Kay Huber wrote on Mon, 21 February 2011 08:01
Hi Manuel

That sounds promising Smile

I have some questions:
* Do you work mainly with command line git or egit in that setup?


I would say it's half-and-half.
Quote:

If egit is used:
* How did you start?


We had a CVS repository, which we migrated with cvs2git, so we always start with cloning the repositories that we need.
Quote:

* I didn't try yet: Is it possible to create a topic branch in the local repo like "feature X" that virtually spans over all remote repos? (Like if I want to add a feature that affects platform, core and ui at the same time).


No, thats not possible with EGit and Git. I remember that there is a "fork" of Git, which supports that, but i can't remember the name.
Quote:

If this is possible, how can I push that branch - and all projects affected - to the respective remote repositories?
The most exciting thing I could imagine is, that the topic branch "feature X" is created in all remote repos but in all repos only covers the projects existing there (only platform projects in platform repo etc.)

* When adding a new project, do you have to manually configure the correct remote (upstream?) repo? Is that feasible? I mean: Don't the developers tend forget to do or do a wrong configuration from time to time, thus having projects ending up in wrong repos or not in remote repos at all?


Because we always clone, that's not a problem yet.
But if we start a new project, i prepare a project in Gerrit (we access our Git repositories only via Gerrit), the other developers clone that repository and create new projects in the working directory of that repository. So the upstream configuration is always correct.

Quote:

* I noticed, that with egit it's currently impossible to remove projects (project removal cannot be committed - except with command line git) - did you just never remove projects?
(see https://bugs.eclipse.org/bugs/show_bug.cgi?id=337577)


Since we started with Git just a month ago, we didn't have the necessity to remove a project yet.
Quote:

Thanks for any throughts or hints regarding these questions...
Regards
Kay

[Updated on: Mon, 21 February 2011 15:38]

Report message to a moderator

Re: Setup with multiple repositories [message #655597 is a reply to message #655529] Mon, 21 February 2011 21:26 Go to previous messageGo to next message
Robin Rosenberg is currently offline Robin RosenbergFriend
Messages: 332
Registered: July 2009
Senior Member
On 2011-02-21 16.36, Manuel Doninger wrote:
> Kay Huber wrote on Mon, 21 February 2011 08:01
>> Hi Manuel
>>
>> That sounds promising :)
>>
>> I have some questions:
>> * Do you work mainly with command line git or egit in that setup?
>
> I would say it's half-and-half.
> Quote:
>> If egit is used:
>> * How did you start?
>
> We had a CVS repository, which we migrated with cvs2git, so we always
> start with cloning the repositories that we need.
> Quote:
>> * I didn't try yet: Is it possible to create a topic branch in the
>> local repo like "feature X" that virtually spans over all remote
>> repos? (Like if I want to add a feature that affects platform, core
>> and ui at the same time).
>
> No, thats not possible with EGit and Git. I remember that there is a
> "fork" of Git, which supports that, but i can't remember the name.

The only thing so far is that you can commit to multiple repos in one
go. Everybody does not agree on the usefulness of this feature. I think
it's useful, but that's me. If you need it it, however it is also a
potential sign of bad design, but then again, we don't always choose the
design of code we didn't write.

There's also a bug in that it attaches the sam Change-Id to the commit
in the repos involved if you use change ids.

-- robin
Re: Setup with multiple repositories [message #656324 is a reply to message #655475] Fri, 25 February 2011 06:53 Go to previous message
Kay Huber is currently offline Kay HuberFriend
Messages: 36
Registered: July 2009
Member
Thanks a lot for your replies.

I guess, the one to one (each remote repo has an according local repo) mapping as described by Manuel is the simplest and most straight forward approach - and the one I'll try next.

My original idea was to have multiple remote repos but only one local - which is apparently possible with git.
Now if that's possible, my next thought was, that the local git repo must have some means to distinguish the projects coming from the various remote repos and that it must be possible to create new projects and "assign" them to a remote one. To some extent, that seems to be possible (in egit, it's possible to configure an upstream repo for a project under git control - however, I didn't really succeed to select another than the first remote there is, possibly a bug - or a limitation after all).
But then again it seems not to be possible to just execute "push" on the local repo and expect all changes to magically go back in their respective origin. Instead, I have to select, where to push to, that's where my doubts started Wink

The advantage of the "one local repo" approach would have been, that I could have created branches (e.g. topic / feature branch) "over" all projects from all remote repos. Functionality like "git stash" would have made more sense to me in such a setup. Actually I'm not sure how useful git stash is if I'm having multiple local repositories - I must always make sure to execute git stash on all repos to be sure not to mix things up, no?
When thinking about using mylyn in the future, what's going to happen if I switch tasks with the multiple local repos? In a setup with topic branches, I'd expect mylyn to create a new branch for a new feature. Will it create that branch in all local repos? Or will it create them only "on demand" once I start editing?

Having said all that, I'm not sure what purpose the "multiple remotes possibility" in git actually has. It seems to be "merge multiple remotes into one", and after the merge you better drop all origin info...

Regards
Kay
Previous Topic:Confused about Team Share with no former git repo
Next Topic:Password not stored
Goto Forum:
  


Current Time: Fri Apr 26 03:56:52 GMT 2024

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

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

Back to the top