3

I'm using git where I have a repo containing about 40 (!) submodule repos.

Whenever I do a git git push origin master it's very slow on the remote: Processing changes action.

Is there any way I can speed up the push? Gerrit is used as a backend but I'm overriding the HEAD:refs/for/master to short circuit the review mechanism.

PS. I know I have alot of sub repos and that might not be optimal, but that's how it is and the question isn't about this :-)

Henrik
  • 1,983
  • 3
  • 28
  • 52

2 Answers2

2

OK found the problem:

The top repo was tracking master branch. This means when I push to origin in each sub repo the top repo is updated automatically (in Gerrit).

I didn't understand this so I also did a push on the top repo and this caused the very long processing time.

Dunno why though.

Henrik
  • 1,983
  • 3
  • 28
  • 52
2

Is there any way I can speed up the push?

With the next git 2.12.0 (Q1 2017), that process (of testing if submodules need to be pushed) will be much faster.

See commit 250ab24, commit 5b6607d, commit 9cfa1c2, commit 1473944 (16 Nov 2016) by Heiko Voigt (hvoigt).
(Merged by Junio C Hamano -- gitster -- in commit af952da, 16 Dec 2016)

serialize collection of changed submodules

To check whether a submodule needs to be pushed we need to collect all changed submodules. Lets collect them first and then execute the possibly expensive test whether certain revisions are already pushed only once per submodule.

There is further potential for optimization since we can assemble one command and only issued that instead of one call for each remote ref in the submodule.

Henrik
  • 1,983
  • 3
  • 28
  • 52
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250