git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git submodule set-url does not sync when name != path

From
Jan Alexander Steffens (heftig) <heftig@archlinux.org>
Date
Jul 24, 2023, 04:21 UTC
Message-ID
<cafa28e0bfe1f603204a74f619ac713518989a40.camel@archlinux.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
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 -----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQQGaHodnU+rCLUP2Ss7lKgOUKR3xwUCZL38OhUcaGVmdGlnQGFy Y2hsaW51eC5vcmcACgkQO5SoDlCkd8cfsAD+M6POceTxAkFpnnmAH7j3RYLBEjFP w4kzY3U0UPVMU3wBAIPRBGjiwGFp/ws/iMeGQKif1E0ElqcxEbFAQ36HytIG =4OVq -----END PGP SIGNATURE-----

Next: Jan Alexander Steffens (heftig)
Message 1 of 19 in “git submodule set-url does not sync when name != path”
  1. Jan Alexander Steffens (heftig)Jul 24, 2023
  2. Bug: git submodule set-url does not handle name != path correctlyJan Alexander Steffens (heftig), Sep 9, 2023
  3. 1/6 submodule--helper: use submodule_from_path in set-{url,branch}Jan Alexander Steffens (heftig), Oct 3, 2023
  4. 2/6 submodule--helper: return error from set-url when modifying failedJan Alexander Steffens (heftig), Oct 3, 2023
  5. Junio C HamanoOct 3, 2023
  6. 5/6 t7419: Test that we correctly handle renamed submodulesJan Alexander Steffens (heftig), Oct 3, 2023
  7. 4/6 t7419, t7420: Use test_cmp_config instead of grepping .gitmodulesJan Alexander Steffens (heftig), Oct 3, 2023
  8. 3/6 t7419: Actually test the branch switchingJan Alexander Steffens (heftig), Oct 3, 2023
  9. Junio C HamanoOct 4, 2023
  10. 6/6 t7420: Test that we correctly handle renamed submodulesJan Alexander Steffens (heftig), Oct 3, 2023
  11. Junio C HamanoOct 4, 2023
  12. 1/6 submodule--helper: use submodule_from_path in set-{url,branch}Jan Alexander Steffens (heftig), Nov 21, 2023
  13. 2/6 submodule--helper: return error from set-url when modifying failedJan Alexander Steffens (heftig), Nov 21, 2023
  14. 4/6 t7419, t7420: use test_cmp_config instead of grepping .gitmodulesJan Alexander Steffens (heftig), Nov 21, 2023
  15. 3/6 t7419: actually test the branch switchingJan Alexander Steffens (heftig), Nov 21, 2023
  16. 5/6 t7419: test that we correctly handle renamed submodulesJan Alexander Steffens (heftig), Nov 21, 2023
  17. 6/6 t7420: test that we correctly handle renamed submodulesJan Alexander Steffens (heftig), Nov 21, 2023
  18. Junio C HamanoNov 22, 2023
  19. Jan Alexander Steffens (heftig)Nov 22, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.