git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 17:22 UTC

Re: Option for "git submodule foreach" to also run on the parent git?

From
Florian Schmidt <flosch@nutanix.com>
Date
Mar 9, 2026, 17:43 UTC
Message-ID
<66419a04-67b0-4b60-bf23-078cf92b2c04@nutanix.com>
In-Reply-To
<xmqqsea9591f.fsf@gitster.g>
On 2026-03-09 15:15, Junio C Hamano wrote:
Show 8 quoted lines
> Florian Schmidt <flosch@nutanix.com> writes:
> 
>> would there be an appetite for a new option to "git submodule foreach"
>> to run the foreach command on the parent git repo as well?
> 
> Not from me.  After all, the top-level superproject is not a
> submodule from the point of view of the tree, is it?  If it were
> "git submodule-and-superproject foreach", then perhaps,

True, I was thinking that, but figured an option such as "--also-parent" would be sufficiently clear as to what's happening. But I can see that it's maybe pretty niche and potentially confusing.

Show 5 quoted lines
> but at that
> point, wouldn't it be simpler to explain what you are doing as
> 
>      do-this . ;# do it here
>      git submodule foreach do-this ;# do it there all over

That's basically what's I'm doing. I figured instead of doing "foo && git submodule foreach foo", a "git submodule foreach --also-parent foo" would be marginally neater. But I don't feel strongly about it.

Cheers, Florian

Previous: Junio C HamanoNext: Jeff King
Message 3 of 6 in “Option for "git submodule foreach" to also run on the parent git?”
  1. Florian SchmidtMar 9, 2026
  2. Junio C HamanoMar 9, 2026
  3. Florian SchmidtMar 9, 2026
  4. Jeff KingMar 9, 2026
  5. brian m. carlsonMar 9, 2026
  6. D. Ben KnobleMar 9, 2026

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.