git-meta icon indicating copy to clipboard operation
git-meta copied to clipboard

git meta push to multiple refspecs can cause lock problems in submodules

Open jhedwardyang opened this issue 8 years ago • 4 comments

There's no need to push refs in submodules twice. It's the same operation.

cannot lock ref 'refs/commits/<sha>'

jhedwardyang avatar Feb 23 '17 22:02 jhedwardyang

@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".

bpeabody avatar Feb 23 '17 23:02 bpeabody

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.

jhedwardyang avatar Feb 24 '17 18:02 jhedwardyang

Got it. The phrase "synthetic hook" made me think it was a problem with the server-side hook.

bpeabody avatar Feb 24 '17 18:02 bpeabody

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).

bpeabody avatar Mar 30 '17 12:03 bpeabody