submodule foreach: document '$sm_path' instead of '$path'
As using a variable '$path' may be harmful to users due to capitalization issues, see 64394e3ae9 (git-submodule.sh: Don't use $path variable in eval_gettext string, 2012-04-17). Adjust the documentation to advocate for using $sm_path, which contains the same value. We still make the 'path' variable available and document it as a deprecated synonym of 'sm_path'. Discussed-with: Ramsay Jones <ramsay@ramsayjones.plus.com> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Prathamesh Chavan <pc44800@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Prathamesh Chavan committed
May 8, 2018 at 17:29 UTC
f0fd0dc5c5fcc066fc2e0b7dc1e809cb2d219ee3
1 file changed
+7
-4
Documentation/git-submodule.txt
+7
-4
@@ -183,12 +183,15 @@ information too.
183
184
foreach [--recursive] <command>::
185
Evaluates an arbitrary shell command in each checked out submodule.
186
- The command has access to the variables $name, $path, $sha1 and
186
+ The command has access to the variables $name, $sm_path, $sha1 and
187
$toplevel:
188
$name is the name of the relevant submodule section in `.gitmodules`,
189
- $path is the name of the submodule directory relative to the
190
- superproject, $sha1 is the commit as recorded in the superproject,
191
- and $toplevel is the absolute path to the top-level of the superproject.
189
+ $sm_path is the path of the submodule as recorded in the immediate
190
+ superproject, $sha1 is the commit as recorded in the immediate
191
+ superproject, and $toplevel is the absolute path to the top-level
192
+ of the immediate superproject.
193
+ Note that to avoid conflicts with '$PATH' on Windows, the '$path'
194
+ variable is now a deprecated synonym of '$sm_path' variable.
195
Any submodules defined in the superproject but not checked out are
196
ignored by this command. Unless given `--quiet`, foreach prints the name
197
of each submodule before evaluating the command.