]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-pr-submodules: add docs snippet for shell variables in foreach
authorAlfredo Deza <adeza@redhat.com>
Mon, 21 Nov 2016 17:14:05 +0000 (12:14 -0500)
committerAlfredo Deza <adeza@redhat.com>
Mon, 21 Nov 2016 17:30:05 +0000 (12:30 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
ceph-pr-submodules/build/build

index 34a86d6c6559e48ba44a98b60381bcce3951a832..56c5fa18dbebe4105b7331f2725285a38485793d 100644 (file)
@@ -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