Depends on D19829. Ref T13216. See PHI908. The current implementation is kind of a lot to live in CommitHookEngine and will likely fail if git diff-tree produces more than 2GB of output.
Pull it out and make it slightly more robust against enormous commits. It's probably limited by this, now:
implode("\n", $every_path)
We could replace that with some PhutilReverseRopeSource primitive or something but since we don't have one of those and it seems unlikely that we'll hit this case in practice, I left it here for now with just the easy stuff converted to be stream-oriented.