On Mon, 2023-07-24 at 06:21 +0200, Jan Alexander Steffens (heftig) wrote: > Hi, > > I've encountered this problem with the flatpak-builder repository: > > https://github.com/flatpak/flatpak-builder/blob/main/.gitmodules > > [submodule "libglnx"] > path = subprojects/libglnx > url = https://gitlab.gnome.org/GNOME/libglnx.git > [submodule "debugedit"] > path = subprojects/debugedit > url = https://sourceware.org/git/debugedit.git > > After 'git submodule init', using 'git submodule set-url libglnx foo' > successfully modifies .gitmodules but does not touch .git/config. > However, a subsequent 'git submodule sync' does sync the modified url > to the local config. > > I've investigated a bit and it seems 'git submodule set-url' calls > sync_submodule with "libglnx" as the path, which does not work, while > 'git submodule sync' calls it with "subprojects/libglnx" as the path, > which does work. > > Greetings, > Jan Friendly bump. The docs say set-url needs the path to the submodule, not its name, so it should be 'git submodule set-url subprojects/libglnx foo'. However, using that actually creates a new 'submodule.subprojects/libglnx.url' option instead of modifying the existing 'submodule.libglnx.url'. It looks like set-url needs to translate the path to the name for modifying .gitmodules but does not do so. 'git submodule set-branch' is also affected by this.