From 0be3cbab9a71f33d4f3c47b04ad655a0251d5ed1 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Mon, 21 Nov 2016 12:14:05 -0500 Subject: [PATCH] ceph-pr-submodules: add docs snippet for shell variables in foreach Signed-off-by: Alfredo Deza --- ceph-pr-submodules/build/build | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.39.5