views:

40

answers:

1

Hi,

I develop a lot of Zend Framework based applications with reusable modules (e.g. mailing module, cms module etc.)

Each project has it's own centralized repository and uses some of the common modules. Each time I update the module in one of the projects, it is very likely that I need to update the module in the other projects too.

Which is the best way to have those reusable modules synchronized? Do I need ~10 git submodules for each Zend Framework project? What is your practice? Separate repo for each module outside the project?

A: 

the question of highly coupled submodules did already come up before, and Jefromi kept the central model:

Every modification of a submodule is:

  • first preceded by a fetch and rebase (to rebase the local submodule work on top of that same submodule fetch from one central repo)
  • pushed to the central repo for that submodule
  • pushed only if the merge on that central subrepo is a fast-forward one.

That way, you enforce synchronization of that submodule amongst all the parent repos out there needed the common module, because:

  • they will first fetch and rebase
  • they won't be able to push back that submodule if the merge isn't a fast-forward one.
VonC