Provide work around to prevent bidirectional mirroring conflicts
Improvements have been made to mirroring to reduce the chance of conflicts when mirroring bidirectionally, but there is still the chance of conflicts. In the documentation we write:
It may be possible to implement a locking mechanism using the server-side pre-receive hook to prevent the race condition. Read about configuring custom Git hooks on the GitLab server.
Proxying each push to the upstream Git repository (or perhaps authoritative P4 server mirrored via GitFusion) is not very fast. The performance concerns are most concerning when used with GitFusion because it is known to be slow. But, for customers going this route to migrate to GitLab from Perforce, preventing conflicts may be more important than snappy Git access. If only a subset of branches are mirrored, like master
and release branches it may be tolerable.
We should provide a sample custom_hooks/pre-receive
for self hosted customers in this situation.
Proposal
Provide a sample pre-recieve
hook that proxies each push to the upstream project.
Note: this is the same approach that was used by GitSwarm (all pushes were proxied to GitFusion in the pre-receive hook to prevent conflicts)