From 1e7f2aad7dd9b0b5ec8bbae2e3015915687e2cd2 Mon Sep 17 00:00:00 2001 From: Johan Herland Date: Sun, 16 Aug 2009 03:10:08 +0200 Subject: git submodule foreach: Provide access to submodule name, as '$name' The argument to 'git submodule foreach' already has access to the variables '$path' (the path to the submodule, relative to the superproject) and '$sha1' (the submodule commit recorded by the superproject). This patch adds another variable -- '$name' -- which contains the name of the submodule, as recorded in the superproject's .gitmodules file. Signed-off-by: Johan Herland Signed-off-by: Junio C Hamano --- git-submodule.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'git-submodule.sh') diff --git a/git-submodule.sh b/git-submodule.sh index ebed711da4..d8ecdb91fe 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -243,6 +243,7 @@ cmd_foreach() if test -e "$path"/.git then say "Entering '$path'" + name=$(module_name "$path") (cd "$path" && eval "$@") || die "Stopping at '$path'; script returned non-zero status." fi -- cgit v1.2.3