This is the same thing as `git rebase-update`, available in Chrome's `depot_tools`, which deletes merged branches.
Beyond that, this is just OP learning how `xargs` works.