From: Glen Choo <email@example.com>
To: Jonathan Tan <firstname.lastname@example.org>, Taylor Blau <email@example.com>
Cc: Jonathan Tan <firstname.lastname@example.org>, email@example.com
Subject: Re: [PATCH] submodule: explicitly specify on-demand upon push
Date: Wed, 09 Nov 2022 10:31:05 -0800 [thread overview]
Message-ID: <firstname.lastname@example.org> (raw)
Jonathan Tan <email@example.com> writes:
>> Not having thought about this a lot, the behavior I might expect is
>> something along the lines of recursively pushing throughout the
>> submodule tree, stopping the recursion as soon as we get to a nested
>> submodule which says "don't push any of my children".
>> On the other hand, I could sympathize with a compelling argument that
>> the superproject alone should be in charge of determining what gets
>> Though TBH, it seems like the former is more convincing. If I depend on
>> an external repository through a submodule, and that repository itself
>> has submodules, it would be nice to configure (once) that I don't want
>> to even try and push any of that repository's children.
> I just tried this and the behavior is reasonable except possibly for when
> push.recurseSubmodules=only is configured in a top-level submodule. Let's see
> if other people have something to say. For me, this would also be fine since we
> can just make sure that we don't configure "only" in top-level submodules that
> have their own nested submodules.
For this patch, I think what Jonathan has proposed is preferable because
that's close to what "git fetch"  does, i.e. when a superproject has
parsed a setting for "recurse into submodules" (from either the CLI or
config), it passes that value to its submodules via
"--recurse-submodules", overriding the submodule's config.
In the longer term though, I think neither "git fetch" nor "git push"
(as of this patch) gets it right. I think it should be closer to:
- If the user has passed a "--recurse-submodules" flag via the CLI,
respect that in the superproject and all submodules regardless of
nesting. (Make sure not to conflate config values with the CLI option
in the way "git fetch" does today.)
- Otherwise, each submodule should respect their own config setting if
it is set.
- Otherwise, each submodule should respect their superproject's config
setting if it is set.
 "git fetch" is somewhat more complicated than this, since it also
reads values from .gitmodules and passes a "default" value, neither of
which is relevant here I think. See this ML thread for some previous
next prev parent reply other threads:[~2022-11-09 18:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-08 0:25 [PATCH] submodule: explicitly specify on-demand upon push Jonathan Tan
2022-11-08 0:31 ` Taylor Blau
2022-11-08 21:43 ` Jonathan Tan
2022-11-09 18:31 ` Glen Choo [this message]
2022-11-14 21:37 ` [PATCH v2] Doc: document push.recurseSubmodules=only Jonathan Tan
2022-11-14 21:57 ` Taylor Blau
2022-11-15 0:59 ` Glen Choo
2022-11-15 18:47 ` Jonathan Tan
2022-11-16 21:21 ` Glen Choo
2022-11-16 22:35 ` Taylor Blau
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:
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* 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.
Code repositories for project(s) associated with this public inbox
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 read-only IMAP folder(s) and NNTP newsgroup(s).