Is it possible to react to a push to a repository with a hook and merge all new heads that are created by this push?
My use case for this is the following: I'm trying to design a repository that would only allow very specific changes with a commit hook. The basic idea is that it is only allowed to replace existing files with better files (better is something that can be checked by an external program). Each user could clone a central repository and commit changes to the clone. When a user pushes his changes to the central repository, a hook checks whether the quality increases along each branch and rejects the push otherwise. If users push out of sync, this will create multiple heads that could in theory be merged automatically (taking the best version of each file).