At my company we have several pseudo-independent teams, owning several repositories each (but sometimes editing code from another team). Most of the modules are interdependent, although the modules closest to our "infrastructure" level are basically independent of the others.
Currently we have a bunch of scripts to handle things like cloning and updating all the modules, requiring also the (in this case mostly automated) maintenance of text lists of the modules. Obviously this is a role I believe/hope git submodule
could fill.
What I would like, at a minimum, is the ability to:
Clone the entire source tree with a single command analogous to git clone main_repository
.
Update the entire source tree with a command analagous to git pull
. It looks like this is simply git submodule foreach git pull
, although I will probably make an alias for git submodule foreach git
. Our current setup does this step in parallel (four at a time), I'd like the submodule setup to do the same. It also looks like updating the submodules makes them show up as changed (for committing). I can understand the logic behind this, but our current system has the pseudo-submodules in .gitignore, as you usually only care about your own module's changes.
I would like an analogue for git grep
that works over the entire tree. At first blush it seemed git submodule foreach git grep hello
would work, but if the search string is ever not found (we have a couple tiny submodules, so this is usually true) then grep returns 1
and the entire command stops.
I'd like similarly useful analogues for diff and status.
I can think of some workarounds for parts of this, but we already have a set of hacky scripts doing most of what I want, I was hoping/wondering if there was a nice standard easy way to do it.