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