: $ git filter-branch --prune-empty --index-filter "$SPELL" -- --all
Alter the =grep= stuff as you need. The goal is to remove anything
-you want to keep from the listing produced by =SPELL=.
+you want to keep from the listing produced by =SPELL=. If the spell
+becomes too complicated, you can move it to a standalone script:
+
+ : $ cat /tmp/spell.sh
+ : #!/bin/bash
+ : git ls-tree -r …
+ : …
+ : $ git filter-branch --prune-empty --index-filter /tmp/spell.sh -- --all
Merge it into =REPO_B=: