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

Re: [PATCH] submodule: explicitly specify on-demand upon push

From
JTJonathan Tan <jonathantanmy@google.com>
Date
Nov 8, 2022, 21:43 UTC
Message-ID
<20221108214344.272053-1-jonathantanmy@google.com>
In-Reply-To
<Y2mjTGvBUYpIicFl@nand.local>
Taylor Blau <me@ttaylorr.com> writes:
Show 8 quoted lines
> 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.

Show 13 quoted lines
> 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.

Previous: Taylor BlauNext: Glen Choo
Message 3 of 10 in “submodule: explicitly specify on-demand upon push”
  1. submodule: explicitly specify on-demand upon pushJonathan Tan, Nov 8, 2022
  2. Taylor BlauNov 8, 2022
  3. Jonathan TanNov 8, 2022
  4. Glen ChooNov 9, 2022
  5. Doc: document push.recurseSubmodules=onlyJonathan Tan, Nov 14, 2022
  6. Taylor BlauNov 14, 2022
  7. Glen ChooNov 15, 2022
  8. Jonathan TanNov 15, 2022
  9. Glen ChooNov 16, 2022
  10. Taylor BlauNov 16, 2022

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.