Skip to content

Fixed issue #3935: speedup git submodule update

TortoiseGit's dialog "Submodule Update" executes only one command of git submodule update instead of one per selected submodule. If all submodules are selected, nothing needs to be specified to this command. If a subset of submodules is selected, a space-sepearated list of submodules is specified after the trailing -- for this command. In both cases, git still outputs status information on which submodules have been checked out to a new hash or for which an error occurred.

The fix introduces a bool to remember whether all submodules have been selected in the dialog. If this is the case, the command "git submodule update" is taken as is (with the options specified of course). Otherwise, a space-separated list of the selected submodules is provided as argument to the command.

With this fix, the update of the submodules is much faster. The example reported in #3935 (closed) takes only six seconds compared to 14 seconds, see submodule_update_optimized_taking_in_total_6_seconds.

Please note: The savings are huger, the more submodules are involved. This is caused by the call to git.exe which has a large overhead in running compared to the desired action.

Selecting a subset of submodules is also quite fast now. The screenshot shows the constructed command with the space-separated list of submodules' paths: submodule_update_optimized_with_subset_of_submodules.

In case of an error, the output window still clearly shows which submodule failed despite being done by one git command. So it is still feasible to identify the submodules where errors occurred, see submodule_update_successful_and_failed_update

Edited by meigelb

Merge request reports