Skip to content

pr-git-2509/kairosci/topic/status-submodule-url-sync-v2

tagged this 27 Nov 16:16
When a submodule URL changes in .gitmodules, the corresponding URL in the
superproject's .git/config may keep pointing at the old location. This
series makes git status warn about that mismatch and suggest git submodule
sync.

The warning resolves relative URLs as git submodule sync does. It also
suppresses the warning when the populated submodule has a custom remote URL
that a sync would overwrite.

The series is split into:

 1. submodule: prepare URL helpers for reuse
 2. status: warn about stale submodule URLs

Changes since v1:

 * Move the URL helper extraction into a preparatory commit.
 * Clarify the comparison between the cached URL, .gitmodules, and the
   populated submodule's remote URL.
 * Keep test output inside its fixture directory.

Closes gitgitgadget/git#565

Alessio Attilio (2):
  submodule: prepare URL helpers for reuse
  status: warn about stale submodule URLs

 builtin/submodule--helper.c |  63 ++++------------------
 submodule.c                 |  44 +++++++++++++++
 submodule.h                 |   3 ++
 t/t7508-status.sh           |  54 +++++++++++++++++++
 wt-status.c                 | 104 ++++++++++++++++++++++++++++++++++++
 5 files changed, 215 insertions(+), 53 deletions(-)

base-commit: acba8bf9753134d9bde89f94369f775838a8c5fe

Submitted-As: https://lore.kernel.org/git/pull.2509.v2.git.git.1795796162.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2509.git.git.1795774880142.gitgitgadget@gmail.com
Assets 2
Loading