git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jonathan Tan <jonathantanmy@google.com>
To: Taylor Blau <me@ttaylorr.com>
Cc: Jonathan Tan <jonathantanmy@google.com>, git@vger.kernel.org
Subject: Re: [PATCH] submodule: explicitly specify on-demand upon push
Date: Tue,  8 Nov 2022 13:43:43 -0800	[thread overview]
Message-ID: <20221108214344.272053-1-jonathantanmy@google.com> (raw)
In-Reply-To: <Y2mjTGvBUYpIicFl@nand.local>

Taylor Blau <me@ttaylorr.com> writes:
> On Mon, Nov 07, 2022 at 04:25:52PM -0800, Jonathan Tan wrote:
> > This now means that any push.recurseSubmodules configuration in any
> > submodule is no longer respected: only the configuration (or CLI
> > argument to override it) of the superproject is used. Update the
> > documentation accordingly.
> 
> Hmm. Is that a desired outcome or an unfortunate side-effect of the
> implementation below?

What started this effort was investigating whether push.recurseSubmodules
could be set to "only", since that is something that would be useful at
$DAYJOB. It turns out that push.recurseSubmodules is not documented to
take "only", but it is supported, with the caveat that if a repository has
push.recurseSubmodules=only, you cannot recursively push in its superproject
because there is a check that submodules have been pushed, and with this
setting, that submodule is not pushed (since only nested submodules are
pushed).

In addition, there is the usage of the word "recursively" when describing
"--recurse-submodules=only"...

  If only is used all submodules will be recursively pushed while the
  superproject is left unpushed.

...even though this is not true with the default configuration. (Having said
that, there is no "recursively" with --recurse-submodules=on-demand, so maybe
it is the non-recursive meaning that is intended.)

So all this led me to think that it's best if only the top-level configuration
is used, but I'm open to other ideas.

> 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
> pushed.
> 
> 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.

  reply	other threads:[~2022-11-08 21:43 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 [this message]
2022-11-09 18:31     ` Glen Choo
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

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

  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 \
    --in-reply-to=20221108214344.272053-1-jonathantanmy@google.com \
    --to=jonathantanmy@google.com \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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).