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

Re: [PATCH] git-submodule - Add 'foreach' subcommand

From
Johan Herland <johan@herland.net>
Date
Aug 10, 2008, 22:22 UTC
Message-ID
<200808110022.33696.johan@herland.net>
In-Reply-To
<1218386647-2348-1-git-send-email-mlevedahl@gmail.com>
On Sunday 10 August 2008, Mark Levedahl wrote:
Show 21 quoted lines
> submodule foreach <command-list> will execute the list of commands in
> each currently checked out submodule directory. The list of commands
> is arbitrary as long as it is acceptable to sh. The variables '$path'
> and '$sha1' are availble to the command-list, defining the submodule
> path relative to the superproject and the submodules's commitID as
> recorded in the superproject (this may be different than HEAD in the
> submodule).
>
> This utility is inspired by a number of threads on the mailing list
> looking for ways to better integrate submodules in a tree and work
> with them as a unit. This could include fetching a new branch in each
> from a given source, or possibly checking out a given named branch in
> each. Currently, there is no consensus as to what additional commands
> should be implemented in the porcelain, requiring all users whose needs
> exceed that of git-submodule to do their own scripting. The foreach
> command is intended to support such scripting, and in particular does
> no error checking and produces no output, thus allowing end users
> complete control over any information printed out and over what
> constitutes an error.
>
> Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Hi,

I was about to send an equivalent patch, but you beat me to it. Yours is shorter and more elegant as well, so thanks for saving me the embarrasment ;)

So, FWIW:
Liked-by: Johan Herland <johan@herland.net>
-- 
Johan Herland, <johan@herland.net>
www.herland.net
Previous: Mark LevedahlNext: Junio C Hamano
Message 2 of 10 in “git-submodule - Add 'foreach' subcommand”
  1. git-submodule - Add 'foreach' subcommandMark Levedahl, Aug 10, 2008
  2. Johan HerlandAug 10, 2008
  3. Junio C HamanoAug 10, 2008
  4. git-submodule - Add 'foreach' subcommandMark Levedahl, Aug 10, 2008
  5. Balazs NagyAug 11, 2008
  6. Johannes SchindelinAug 11, 2008
  7. Matthias KestenholzAug 11, 2008
  8. Petr BaudisAug 11, 2008
  9. Junio C HamanoAug 11, 2008
  10. git-submodule foreach - Include output and clarify usage.Mark Levedahl, Aug 12, 2008

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.