public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
* Option for "git submodule foreach" to also run on the parent git?
@ 2026-03-09 12:52 Florian Schmidt
  2026-03-09 15:15 ` Junio C Hamano
  2026-03-09 22:14 ` D. Ben Knoble
  0 siblings, 2 replies; 6+ messages in thread
From: Florian Schmidt @ 2026-03-09 12:52 UTC (permalink / raw)
  To: git

Hey everyone,

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?

I occasionally use "git submodule foreach", for example, to make dev 
branches on all the submodules if I expect to touch them all during a 
dev cycle. Even if I don't need them on all submodule, once I'm done 
with everything, I might run something like "git submodule foreach 'git 
branch -d <foo> || :'" for easy cleanup.

In either case, I likely also want to run the same command on the parent 
git. That's easily achieved by just running it manually one more time, 
and I'm sure it's not hard to make a git alias for that either. But I 
wonder whether the workflow is common enough that there's interest in 
adding a command-line option for that? I'd be happy to have a look in 
that case.

Also, tangentially related, "|| :" works, but what about a command line 
option to continue on non-zero return values and not abort?

Cheers,
Florian

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-03-09 22:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-09 12:52 Option for "git submodule foreach" to also run on the parent git? Florian Schmidt
2026-03-09 15:15 ` Junio C Hamano
2026-03-09 17:43   ` Florian Schmidt
2026-03-09 19:30     ` Jeff King
2026-03-09 21:03       ` brian m. carlson
2026-03-09 22:14 ` D. Ben Knoble

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox