Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git submodule update is slow. How can I debug why it's slow?

Tags:

git

I'm using git submodule and git submodule update --init --recursive command is slow (8 sec) although there seems no changes to be updated.

I want to debug why it's slow but it seems there is no --verbose switch. Any idea to debug what it's doing?

I'm running Ubuntu 14.04 and Git 1.9.

like image 271
kimh Avatar asked Dec 25 '15 07:12

kimh


People also ask

What does git submodule update do?

The git submodule update command sets the Git repository of the submodule to that particular commit. The submodule repository tracks its own content which is nested into the main repository. The main repository refers to a commit of the nested submodule repository.

What is a dirty submodule?

It means the same as with a non-submodule: "dirty" means the index differs from HEAD and/or the work-tree differs from the index. Each submodule is its own repository, so to test if a submodule is dirty, "cd" into the submodule and test whether the repository is dirty.

Is git submodule a good idea?

Git submodules may look powerful or cool upfront, but for all the reasons above it is a bad idea to share code using submodules, especially when the code changes frequently. It will be much worse when you have more and more developers working on the same repos.


1 Answers

Since there is no change to actually checkout and copy, that leaves two main root causes:

  • the url of the submodule is slow to respond
  • or git submodule update was optimized since the old git 1.9: see if the issue persists with the latest git 2.6.4 found in the launchpad ppa
like image 186
VonC Avatar answered Oct 10 '22 01:10

VonC