jenkinsci / jenkinsci/git-plugin

[JENKINS-41553] Git plugin should get list of submodules from git submodule status cmd

Open
#3,034 3 comments 0 reactions 0 assignees View on GitHub
component:git-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

At the moment, the git plugin tries to get the list of submodule by parsing the config:

git config -f .gitmodules --get-regexp ^submodule\.(.*)\.url

If you switch between different branches, you could end up with submodules defined in the config file but not used by git (as a git submodule status command shows).

The git plugin will then try to update all found submodules in the config and fail when trying to update an unused - but in .git/config - submodule.

That's why it would be better to retrieve the list of submodules from the git submodule status command instead.

---
Originally reported by bernard87, imported from: Git plugin should get list of submodules from git submodule status cmd


  • status: Open
  • priority: Minor
  • component(s): git-plugin
  • resolution: Unresolved
  • votes: 2
  • watchers: 4
  • imported: 2025-12-02

Raw content of original issue

At the moment, the git plugin tries to get the list of submodule by parsing the config:
git config -f .gitmodules --get-regexp ^submodule\.(.*)\.url

If you switch between different branches, you could end up with submodules defined in the config file but not used by git (as a git submodule status command shows).
The git plugin will then try to update all found submodules in the config and fail when trying to update an unused - but in .git/config - submodule.

That's why it would be better to retrieve the list of submodules from the git submodule status command instead.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.