git meta push to multiple refspecs can cause lock problems in submodules
There's no need to push refs in submodules twice. It's the same operation.
cannot lock ref 'refs/commits/<sha>'
@jhedwardyang not sure I follow. What code is pushing what refs twice? Also, where is the error coming from? The closest thing I see to this error message in libgit2 is suffixed by "there are refs beneath that folder".
git meta push origin HEAD:ref1 HEAD:ref2 pushes all open submodules twice (in parallel) - sometimes causing lock failures on the synthetic ref in the submodules.
Got it. The phrase "synthetic hook" made me think it was a problem with the server-side hook.
This issue is actually a little less straightforward than I thought. We can't just "not push all submodules" as different ref-specs may or may not indicate that different meta-refs need to be pushed. We need to make a list of which synthetic-meta-refs need to be pushed, push them in parallel, then push the refs in the meta-repo (which can also be pushed in parallel).