Package: recomi
Recomi -- The Repository Collection MirrorRecomi is a
batch-orientated tool for keeping local collections of git repositories
mirroring their remote upstream counterparts.Each "collection" is a directory that contains repositories.
Normally the repositories would be--mirrorones,
but this works with ordinary clones too.At its simplest this tool is little more thangit fetchin aforloop.
But what it also offers is a structured way to find out if there are any
new repositories upstream and then automatically clone them.Usage$ recomi fetch /path/to/collection1 /path/to/collection2...
$ recomi gc /path/to/collection1 /path/to/collection2...
$ recomi clone /path/to/collection1 /path/to/collection2...
$ recomi mirror /path/to/collection1 /path/to/collection2...Themirrorcommand is equivalent to runningfetchthengcthenclonefor each collection.InstallationTo install the last stable version into your current virtualenv run:$ pip install recomiAlternatively you can get the current development version with:$ pip install git+https://github.com/pscl4rke/recomi.gitConfigurationThefetchandgccommands need no configuration.Forcloneyou need to create a config file inside each collection
with the namerecomi.ini.
The bare minimum contents is:[clone]
list = shell-command argument1 argument2...
url = git://example.com/example/{name}.gitUselistto define a shell command that will communicate with the upstream
source and return a list of repositories (one per line).Useurlto turn each listed repository into a clonable SSH/URL pattern.
It will replace{path}with the full path thatlistreturned,
and will replace{name}with just the name part.Also usetypeset to eitherworking,mirror,mirror-fforbareto describe
what type of clone to make.
It is optional and defaults tomirror.
Usingmirror-ffis experimental: it rewrites the fetch ref from+refs/*:refs/*torefs/*:refs/*to prevent forced updates and ensure history is preserved.By default recomi will warn you (on stderr) when it clones a new repository.
Setwarnto false to clone without a warning.If the output oflistcontains paths
(e.g.foo/bar.git)
Recomi's default behaviour is to mimicgit cloneand it will only use the basename
(resulting inbarorbar.gitgetting cloned).
Settingonlybaseto false will include the path prefix
in the cloned destination,
with slashes converted to double underscores
(sofoo__barorfoo__bar.gitwill be locally created).
This is useful for hosting forges that file repositories
under username or organisation subsections,
as the subsections might have duplicate names.Another example:[clone]
list = ssh mygithost list | grep -v bigrepo
url = mygithost:{name}.git
type = workingUsage with CronNote thatrecomidistinguishes between routine output,
which is sent to stdout,
and errors/warnings,
which are sent to stderr.
Thus you can use a shell pipeline or redirection to send stdout to
a log somewhere while letting cron collect up stderr and send it as
an email:8 4 * * * recomi fetch /path/to/dir | logger -t recomi-dirLimitationsRecomi is deliberately only interested in pulling from upstream repositories
in an unattended manner.
If you would like interactive tooling to manage both pulling and pushing repositories
then look into whethermyreposorgitbatchmight be better suited to you.Recomi currently doesn't handle submodules.Recomi currently doesn't manage hook scripts.Recomi may be vulnerable to forced updates unlessmirror-ffis used.Recomi is generally case-sensitive.
Many collection hosts will considerfoobarandFooBarthe same
and allow for smooth renaming,
but Recomi will detect this as a new repository and clone from scratch.DebuggingBy runningmake devyou can create a development virtualenv,
and can run./dev/venv/bin/recomito test out the program.Runningmake testwill run the test suite within the development
virtualenv.By setting the environment variableRECOMI_DRY_RUN=Trueyou can see whichgitcommands would have been run without actually running them.LicenceThis software is licensed under the GPLv3.