aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown
diff options
context:
space:
mode:
authorAntonio Ospite <antonio.ospite@collabora.com>2019-03-29 18:23:13 +0100
committerAntonio Ospite <antonio.ospite@collabora.com>2019-04-01 11:51:02 +0200
commite680dbe0658851bc73d8e664909df9619365e714 (patch)
tree2418b3cf85e6c040a2516732b7f5bdd90b8ed4a9 /docs/markdown
parent5905533fcd7fb9663023e6cf98d95667620d2f12 (diff)
downloadmeson-e680dbe0658851bc73d8e664909df9619365e714.zip
meson-e680dbe0658851bc73d8e664909df9619365e714.tar.gz
meson-e680dbe0658851bc73d8e664909df9619365e714.tar.bz2
Add 'meson subprojects foreach' command
Sometimes it is convenient to run an arbitrary command (e.g. 'git diff') on all subprojects. Add a 'meson subprojects foreach' command to take care of that. For this command the common argument 'subprojects' does not make sense, so only add '--sourcedir' and cover the case of a missing options.subprojects in run().
Diffstat (limited to 'docs/markdown')
-rw-r--r--docs/markdown/Subprojects.md9
-rw-r--r--docs/markdown/snippets/subproject-foreach.md7
2 files changed, 16 insertions, 0 deletions
diff --git a/docs/markdown/Subprojects.md b/docs/markdown/Subprojects.md
index 24b8af6..61b3eca 100644
--- a/docs/markdown/Subprojects.md
+++ b/docs/markdown/Subprojects.md
@@ -241,6 +241,15 @@ changes.
To come back to the revision set in wrap file (i.e. master), just run
`meson subprojects checkout` with no branch name.
+## Execute a command on all subprojects
+
+*Since 0.51.0*
+
+The command-line `meson subprojects foreach <command> [...]` will
+execute a command in each subproject directory. For example this can be useful
+to check the status of subprojects (e.g. with `git status` or `git diff`) before
+performing other actions on them.
+
## Why must all subprojects be inside a single directory?
There are several reasons.
diff --git a/docs/markdown/snippets/subproject-foreach.md b/docs/markdown/snippets/subproject-foreach.md
new file mode 100644
index 0000000..3a8ffc4
--- /dev/null
+++ b/docs/markdown/snippets/subproject-foreach.md
@@ -0,0 +1,7 @@
+## Add new `meson subprojects foreach` command
+
+`meson subprojects` has learned a new `foreach` command which accepts a command
+with arguments and executes it in each subproject directory.
+
+For example this can be useful to check the status of subprojects (e.g. with
+`git status` or `git diff`) before performing other actions on them.