From e680dbe0658851bc73d8e664909df9619365e714 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Fri, 29 Mar 2019 18:23:13 +0100 Subject: 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(). --- docs/markdown/Subprojects.md | 9 +++++++++ docs/markdown/snippets/subproject-foreach.md | 7 +++++++ 2 files changed, 16 insertions(+) create mode 100644 docs/markdown/snippets/subproject-foreach.md (limited to 'docs') diff --git a/docs/markdown/Subprojects.md b/docs/markdown/Subprojects.md index 24b8af6cb..61b3ecafc 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 [...]` 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 000000000..3a8ffc4be --- /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. -- cgit v1.2.3 From 221fb86373ee3b49fd56732fca0286d8ed80eaac Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Mon, 1 Apr 2019 10:39:44 +0200 Subject: docs: fix typo s/responsability/responsibility/ [skip ci] --- docs/markdown/Subprojects.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/markdown/Subprojects.md b/docs/markdown/Subprojects.md index 61b3ecafc..254644185 100644 --- a/docs/markdown/Subprojects.md +++ b/docs/markdown/Subprojects.md @@ -235,7 +235,7 @@ To pull latest version of all your subprojects at once, just run the command: The command-line `meson subprojects checkout ` will checkout a branch, or create one with `-b` argument, in every git subprojects. This is useful when starting local changes across multiple subprojects. It is still your -responsability to commit and push in each repository where you made local +responsibility to commit and push in each repository where you made local changes. To come back to the revision set in wrap file (i.e. master), just run -- cgit v1.2.3