Take as an example Helios: while its separate Maven projects for the processing, exported model, client API, and externally-dependent persistence have been merged sensibly into one united Git repository, it still depends on about 12 different internal library projects, which of course a conscientious developer must clone and pay vague attention to, in order to ensure every master branch agrees enough to actually build, pass tests or maybe even work correctly.
In the old days, I handled this sort of thing with a shell script that basically had a ‘for each directory’ loop over my code folder, and took a Git command as an argument.
Now, I am instead using an open source implementation of a for loop, called myrepos! (Or, brew install mr).
It’s very straightforward to use – you just run mr register in each repo you want to manage, and it will be added to a list in the .mrconfig file. In this file, you can also define what are essentially command aliases that can be called on all repos simultaneously.
I do something slightly different, to support the separation between my universal dotfiles for all machines, and the MetaBroadcast-specific list of locally-checked-out repos.
The main ~/.mrconfig file defines my chosen commands:
The .mrconfig file in ~/Documents lists the repos in the Documents folder (which I use as my code folder here):
So then, when I run mr commands in the ~/Documents folder, they apply to all those repos; when I run them in a specific repo they apply to that one, and outside ~/Documents they apply to whatever is locally relevant (as defined in another .mrconfig file in the hierarchy or passed as an argument).
Very nice / would recommend! More
timewasting timesaving tips later!
btw: git simple-status
¿What’s that?, you obviously ask, eagle-eyed blog-reader.
It’s just a trivial little script that only outputs a status message if the status is other than ‘on the master branch and in sync with origin/master’. This means that the list given by mr st more clearly highlights the information of interest.
That’s all. Bye!