Skip to content

Commit 23a485e

Browse files
committed
git-submodule: rename shell functions for consistency
This renames the shell functions used in git-submodule that implement top-level subcommands. The rule is that the subcommand $foo is implemented by cmd_$foo function. A noteworthy change is that modules_list() is now known as cmd_status(). There is no "submodule list" command. Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 36a189c commit 23a485e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

git-submodule.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ module_name()
8686
#
8787
# Clone a submodule
8888
#
89-
# Prior to calling, modules_update checks that a possibly existing
89+
# Prior to calling, cmd_update checks that a possibly existing
9090
# path is not a git repository.
91-
# Likewise, module_add checks that path does not exist at all,
91+
# Likewise, cmd_add checks that path does not exist at all,
9292
# since it is the location of a new submodule.
9393
#
9494
module_clone()
@@ -121,7 +121,7 @@ module_clone()
121121
#
122122
# optional branch is stored in global branch variable
123123
#
124-
module_add()
124+
cmd_add()
125125
{
126126
repo=$1
127127
path=$2
@@ -174,7 +174,7 @@ module_add()
174174
#
175175
# $@ = requested paths (default to all)
176176
#
177-
modules_init()
177+
cmd_init()
178178
{
179179
git ls-files --stage -- "$@" | grep -e '^160000 ' |
180180
while read mode sha1 stage path
@@ -207,7 +207,7 @@ modules_init()
207207
#
208208
# $@ = requested paths (default to all)
209209
#
210-
modules_update()
210+
cmd_update()
211211
{
212212
git ls-files --stage -- "$@" | grep -e '^160000 ' |
213213
while read mode sha1 stage path
@@ -266,7 +266,7 @@ set_name_rev () {
266266
#
267267
# $@ = requested paths (default to all)
268268
#
269-
modules_list()
269+
cmd_status()
270270
{
271271
git ls-files --stage -- "$@" | grep -e '^160000 ' |
272272
while read mode sha1 stage path
@@ -347,16 +347,16 @@ esac
347347

348348
case "$add,$init,$update,$status,$cached" in
349349
1,,,,)
350-
module_add "$@"
350+
cmd_add "$@"
351351
;;
352352
,1,,,)
353-
modules_init "$@"
353+
cmd_init "$@"
354354
;;
355355
,,1,,)
356-
modules_update "$@"
356+
cmd_update "$@"
357357
;;
358358
,,,*,*)
359-
modules_list "$@"
359+
cmd_status "$@"
360360
;;
361361
*)
362362
usage

0 commit comments

Comments
 (0)