views:

47

answers:

1

I'm working on a big Qt application with multiple widgets which are quite complex. One of this widget is a webcam stream viewer.

The application is organized so that each program module (i.e. widgets) is stored in its own directory with a .pri file. All these are stored in one main directory grouping all the widget directories.

Next to this main project directory I also have application directories. Let say one for each widget. In these directory I have a symbolic link (alias on windows) to the module directory in the main project folder. This application has then the necessary code to build a standalone application showing only the widget. So for instance I have a webcam viewer application, another to control some devices, etc.

This source code organization works well and allows me to develop and test the widgets in independent applications while sharing the code with the main application.

Currently only the main project directory is under version control using subversion.

Now I would like to start using git and would like to know if this shared directory model would work with it or if there is a better way to do it.

+1  A: 

Using submodules, you could define:

  • one main project with n branches (one per widget/test application)
  • one git repo per widget/test application

That way, your main project references all widgets, but you can only focus and test on one on them, depending the branch you are in.
Or you can just clone one of the widget/test app repos and work only on that.

The idea remains: make sure to have related data within one Git repo.
That is why you won't find all widgets within one Git repo, because their development lifecycle could be very different one widget from another.

VonC
Your referenced response is excellent. Thank you very much. Apparently, the shared directories should be turned into submodules. The main app and each widget standalone app should reference the corresponding submodule.
chmike