The git version was duplicated from the stable one and the two had
begun to diverge significantly. For example, commit
88d731925d fixed a supposedly real
bug — but only in the stable package.
Factor out the shared code to avoid trouble — or worse, subtle
differences or bugs — in future.