I'm doing this with the myrepos perl script. I started down the path of reimplementing a good chunk of functionality of myrepos before realizing my mistake and generating a config file instead :)
To generate the config file I used this beauty:
while read repo; do
printf '[%s]\n%s\n\n' "${repo}.git" "checkout = git clone --mirror https://gerrit-replica.wikimedia.org/r/${repo}"
done < <(curl -sL https://gerrit.wikimedia.org/r/projects/?all | \
tail -c +6 | \
jq -r '.|to_entries|map(select(.value.state == "ACTIVE"))|.[].key') > .mrconfig
From there a full mirror was a mr checkout
away.
I add
at the top of mrconfig ...for some reason