From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
To: git@vger.kernel.org
Subject: Bug: git submodule set-url does not handle name != path correctly
Date: Sun, 10 Sep 2023 00:26:30 +0200 [thread overview]
Message-ID: <0a0a157f88321d25fdb0be771a454b3410a449f3.camel@archlinux.org> (raw)
In-Reply-To: <cafa28e0bfe1f603204a74f619ac713518989a40.camel@archlinux.org>
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.
next prev parent reply other threads:[~2023-09-09 22:26 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-24 4:21 git submodule set-url does not sync when name != path Jan Alexander Steffens (heftig)
2023-09-09 22:26 ` Jan Alexander Steffens (heftig) [this message]
2023-10-03 18:50 ` [PATCH 1/6] submodule--helper: use submodule_from_path in set-{url,branch} Jan Alexander Steffens (heftig)
2023-10-03 18:50 ` [PATCH 2/6] submodule--helper: return error from set-url when modifying failed Jan Alexander Steffens (heftig)
2023-10-03 23:10 ` Junio C Hamano
2023-10-03 18:50 ` [PATCH 3/6] t7419: Actually test the branch switching Jan Alexander Steffens (heftig)
2023-10-04 0:20 ` Junio C Hamano
2023-10-03 18:50 ` [PATCH 4/6] t7419, t7420: Use test_cmp_config instead of grepping .gitmodules Jan Alexander Steffens (heftig)
2023-10-03 18:50 ` [PATCH 5/6] t7419: Test that we correctly handle renamed submodules Jan Alexander Steffens (heftig)
2023-10-03 18:50 ` [PATCH 6/6] t7420: " Jan Alexander Steffens (heftig)
2023-10-04 1:10 ` [PATCH 1/6] submodule--helper: use submodule_from_path in set-{url,branch} Junio C Hamano
2023-11-21 20:32 ` [PATCH v2 " Jan Alexander Steffens (heftig)
2023-11-21 20:32 ` [PATCH v2 2/6] submodule--helper: return error from set-url when modifying failed Jan Alexander Steffens (heftig)
2023-11-21 20:32 ` [PATCH v2 3/6] t7419: actually test the branch switching Jan Alexander Steffens (heftig)
2023-11-21 20:32 ` [PATCH v2 4/6] t7419, t7420: use test_cmp_config instead of grepping .gitmodules Jan Alexander Steffens (heftig)
2023-11-21 20:32 ` [PATCH v2 5/6] t7419: test that we correctly handle renamed submodules Jan Alexander Steffens (heftig)
2023-11-21 20:32 ` [PATCH v2 6/6] t7420: " Jan Alexander Steffens (heftig)
2023-11-22 7:54 ` [PATCH v2 1/6] submodule--helper: use submodule_from_path in set-{url,branch} Junio C Hamano
2023-11-22 9:50 ` Jan Alexander Steffens (heftig)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0a0a157f88321d25fdb0be771a454b3410a449f3.camel@archlinux.org \
--to=heftig@archlinux.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).