How about...
(1) In each repository, run "repack -a -d". That would ensure that
everybody has the necessary objects that they themselves need. By
doing this for a repository that borrows from another makes sure
pruning the latter would not break the former, so you start from
leaves and move on to the repositories they borrow from. (2) In each repository, run "repack -a -l -d". By doing this for a
repository that borrows from another repacks the former without
objects it borrows from the latter, so the former repository will
retain what it needs but will borrow what are common from the
latter, so you start from the repository that does not borrow from
anybody else, and move on to the repositories that borrow from the
one you already run this step.