Skip to content

[Enhancement] Submodule recurse on Pull #1342

@FedericoQuin

Description

@FedericoQuin

Git allows configuring the setting submodule.recurse to automatically keep submodules up to date when running various git commands. One of the commands supporting this option is git pull.

In SourceGit however, the pull operation is provided via a git fetch && git merge operation. As a result, when someone pulls in new changes from the remote via sourcegit (that contains changes to a submodule version), the submodule is not updated and marked as a local change.

Could there be a way to add the submodule.recurse functionality to SourceGit? Either via an extra command to update submodules after git merge if the option is configured as true, or by using the git pull command directly in pull operations?

From Git submodules docs:

This can be really confusing, so it’s a good idea to always git checkout --recurse-submodules when your project has submodules. For older Git versions that do not have the --recurse-submodules flag, after the checkout you can use git submodule update --init --recursive to put the submodules in the right state.

Luckily, you can tell Git (>=2.14) to always use the --recurse-submodules flag by setting the configuration option submodule.recurse: git config submodule.recurse true. As noted above, this will also make Git recurse into submodules for every command that has a --recurse-submodules option (except git clone).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions