Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
project organization with git. Some advice needed
View unanswered posts
View posts from last 24 hours

Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message

Joined: 10 Feb 2006
Posts: 572
Location: Hell...

PostPosted: Fri Feb 08, 2013 11:26 am    Post subject: project organization with git. Some advice needed Reply with quote

Hi there.

I code for a living and for a hobby ( I know, i know, I should get a life ).

So, I frequently have a pet project in which i use some.... modules. For example, I have a folder called Utils, with general utility code which i'm always using. Also a folder for a logging system. And another for a OpenGL Framework, etc etc.

So, i created a git repo for each of these. So far so good.

now, I'm trying to get some of this together to build a graphics engine. The opengl framework uses the logging system, so i added the logger as a git submodule of opengl framework. As for utils.
Also, since the graphics engine is supposed to show something, I've written some code to load models from some data files.
But, this code, as I see it, is not supposed to be part of the graphics engine. Whoever loads the models, should have it, right? And then pass the models in an internal object to the graphics engine.

So, I have a Test application, which loads models, and displays them using the graphics engine. As such, the Test application has them as submodules.

So, this tree is the final result:


But now, I have a dilemma. The model loader in the test, also uses the logger, to show data file loading errors, etc etc. And as such, I've began wondering. How should I organize this?
Do I do a #include <GLFramework/Logger/Logger.h> ? That sounds bad. The logger isn't part of a GL Framework, the Framework just uses it.
Also, if I add the Logger as a submodule of the test, it becomes a bit stupid. Two copies of the same code, in the same project??
Also, I could just modify the data loading code or makefile to point two folders above to search for the logger, but that also feels wrong.

So, I tried a different approach. An empty project, with no code, but with a lot of submodules.
It got me this:



All this in the Graphics engine folder.

What i had before trying to use git, was simply, each module in its own folder, and all on the same level, kinda like this last approach.
It works for sharing modules across multiple projects, but then there's no auto fetching of modules by git, etc etc. This way, I have a project with several submodules, and i can automatically fetch all of them, manage them, etc etc.

This still has the problem that I use the Logger for other projects, and if i change something in one project I can either copy the folder to another project, or commit it, and update it on the other project.
I think the best way to do this, was to be able to have a submodule of a project being created on the same level as the project folder, instead of inside it, so every project would see the same code, but i seem to not be able to do it with git.

What do you think? How should I organize this?
pc-rhiakath ~ $ emerge -s happiness
[ Results for search key : happiness ]
[ Applications found : 0 ]


I see dead pixels...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum