From: Alfredo Deza Date: Mon, 21 Nov 2016 17:14:05 +0000 (-0500) Subject: ceph-pr-submodules: add docs snippet for shell variables in foreach X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=0be3cbab9a71f33d4f3c47b04ad655a0251d5ed1;p=ceph-build.git ceph-pr-submodules: add docs snippet for shell variables in foreach Signed-off-by: Alfredo Deza --- diff --git a/ceph-pr-submodules/build/build b/ceph-pr-submodules/build/build index 34a86d6c..56c5fa18 100644 --- a/ceph-pr-submodules/build/build +++ b/ceph-pr-submodules/build/build @@ -1,6 +1,12 @@ #!/bin/bash cd "$WORKSPACE" + +# The command below has access to the variables $name, $path, $sha1 and $toplevel: +# $name is the name of the relevant submodule section in .gitmodules, $path is +# the name of the submodule directory relative to the superproject, $sha1 is +# the commit as recorded in the superproject, and $toplevel is the absolute +# path to the top-level of the superproject. modified_submodules=$(git submodule foreach 'cd $toplevel; git diff --ignore-submodules=dirty origin/master -- $path') if [[ $modified_submodules ]]; then