I have a code
directory, that is currently in svn, which contains multiple sub-directories:
/code
├ Dockerfile # create images for CI containing these packages
├───clitools/ # command line interface to the other repos (qa make-docs, qa test-package, etc.)
├───doclib/ # code for creating/collecting/building docs
├───glapi/ # gitlab api code
├───pkgtools/ # code for working with our standard package structure
├───repolib/ # common svn/git/hg interface
├───synclib/ # fetch code from multiple repos with heterogenous VCSs
├───runners/ # code to run sync/async/parallel tasks
└───testpackage/ # linters, analyzers, testers, builders
these subdirectories are Python packages and live in their individual git repositories. They are svn:ignored (we're using gitlab so we can't list them as svn:externals) and our tooling can fetch latest from all of them with one command.
Some of them import and use code from the others, so it is not uncommon to work on features that span multiple repos.
There is a chicken-and-egg problem whenever a new feature (e.g. when we added the possibility of mapping an s3 bucket into our dev-tree) is added to our global syncspec, where the command to fetch latest from all 100+ repositories:
qa fetch-global ./syncspec.txt
first needs to pull the latest from all code/*
repos and re-run itself with the new syncspec.
There is also an issue when bootstrapping a new developer machine/server, where all the code/*
packages have to be synced and installed before we can fetch all. We pip install -e .
all packages to make development faster.
If everything was on svn we could list the sub-packages as svn:externals and checkins at the code/
level would pick up all changes in the sub-packages - and svn up code
would pull everything. I've read about git submodules, but everyone seems to think they are a bad idea.
Is there a (preferably simple) way to set things up in git so that git clone/pull/push on the code repo would update everything? I.e. with changes in code/doclib and code/glapi I want git push code
to commit to both repos - without having to go to those ("upstream") repos to merge my changes?
Maybe I'm a little bit stuck in a svn mindset and should be approaching this differently?
Currently I'm thinking I'll either need to put all the packages into a giant code
repo containing subdirectories for each package, or use tooling to gloss over the fact that these are separate functionalities but should most of the time be treated as a single unit.