mr (multi-repository) is a useful script by Joey Hess for managing multiple version control check-outs. It's particularly useful for team Debian package maintenance, where you can have a common mrconfig file allowing team members to have easy access to all packages. Here's the mrconfig file for the Games team (which bizarrely only lists git repositories despite being maintained in svn…). It could also be useful for maintaining a collection of puppet modules from separate places.

I frequently find myself wanting to sanity check my local copies of repositories. Have I forgotten to push commits upstream? Are my local branches not up-to-date? In a package management context, have I remembered to tag each package release? Are all the upstream releases tagged?

To aid this process, I've hacked together a script I've called mr-lint. This reads your mrconfig file and performs the above tests on every repository it finds. It attempts to determine whether the check-out is a debian package or not, and performs additional tests where appropriate.

Sample output:

$ mr-lint wd/debian/bup
wd/debian/bup: local branches not present in origin: rescue-diverge
wd/debian/bup: local branch debian does not match origin branch debian
wd/debian/bup: local branch master does not match origin branch master
wd/debian/bup: 5 missing upstream tags: 0.21, 0.17b, 0.20, 0.24b, 0.14a
wd/debian/bup: 3 missing debian tags: debian/0.17b-1, debian/0.20-2,

I've called it mr-lint because I hope that if people think the idea is sound or the script useful, I might be able to adapt it into a patch against mr itself. Here's the script. If there is any interest, I'll put it somewhere more permanent.


comment 1
JFR, some of these checks are done automatically by pet, the package entropy tracker, if such an instance is set up for the group.
comment 2
Would it perhaps make more sense to generalize this to a vcs-lint that only lints the repository in the current directory? Then 'mr lint' could just run vcs-lint once per package.
comment 3

Thanks for your comments!

Nomeata, that's interesting. I think we use PET for most of the games team packages, at least. However, one of the most useful tests for me is the "you've forgotten to push local commits", which a (remote) PET couldn't detect.

Joey, that sounds wise, thanks.

jmtd [],