diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-08-20 23:42:33 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-08-20 23:42:33 -0700 |
commit | 5630feaf370e15c01ef8a6aa469bfd656c1d1cd7 (patch) | |
tree | 32b710660b7ee69cbeba3b0caca16769bcad50a7 /Documentation | |
parent | 299c3714d433b0427a49a10977cc021c52f0aeb8 (diff) | |
parent | 19a31f9c1a6b18abd8a7f20d616516afca36a6a3 (diff) | |
download | git-5630feaf370e15c01ef8a6aa469bfd656c1d1cd7.tar.gz |
Merge branch 'ml/submodule-foreach'
* ml/submodule-foreach:
git-submodule - Add 'foreach' subcommand
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/git-submodule.txt | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt index bf33b0cba0..abbd5b72de 100644 --- a/Documentation/git-submodule.txt +++ b/Documentation/git-submodule.txt @@ -14,6 +14,7 @@ SYNOPSIS 'git submodule' [--quiet] init [--] [<path>...] 'git submodule' [--quiet] update [--init] [--] [<path>...] 'git submodule' [--quiet] summary [--summary-limit <n>] [commit] [--] [<path>...] +'git submodule' [--quiet] foreach <command> DESCRIPTION @@ -123,6 +124,22 @@ summary:: in the submodule between the given super project commit and the index or working tree (switched by --cached) are shown. +foreach:: + Evaluates an arbitrary shell command in each checked out submodule. + The command has access to the variables $path and $sha1: + $path is the name of the submodule directory relative to the + superproject, and $sha1 is the commit as recorded in the superproject. + Any submodules defined in the superproject but not checked out are + ignored by this command. Unless given --quiet, foreach prints the name + of each submodule before evaluating the command. + A non-zero return from the command in any submodule causes + the processing to terminate. This can be overridden by adding '|| :' + to the end of the command. ++ +As an example, "git submodule foreach 'echo $path `git rev-parse HEAD`' will +show the path and currently checked out commit for each submodule. + + OPTIONS ------- -q:: |